Skip to content

Commit

Permalink
Merge pull request #1002 from bitholla/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
abeikverdi authored Oct 21, 2021
2 parents 8804107 + 416ca4b commit f69c796
Show file tree
Hide file tree
Showing 38 changed files with 194 additions and 93 deletions.
4 changes: 3 additions & 1 deletion test/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Get Started

HollaEx Kit provides a simple (but powerful) E2E tool to help exchange operators test the exchange. Get started by install HollaEx TEST, then set the .env and run:
HollaEx Kit provides a simple (but powerful) E2E tool to help exchange operators test the exchange. Get started by install HollaEx TEST, then set the .env and run scenarios in Selenium/Scenario.
The test will be logged in the .log, ultimately run:
npx cucumber-js
85 changes: 71 additions & 14 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "bitHolla Inc.",
"keywords": [],
"dependencies": {
"chromedriver": "92.0.0",
"chromedriver": "93.0.0",
"console-log-to-file": "1.0.3",
"console-stamp": "3.0.3",
"dotenv": "10.0.0",
"get-urls": "10.0.0",
Expand All @@ -16,6 +17,7 @@
"package.json": "2.0.1",
"randomstring": "1.2.1",
"selenium-webdriver": "4.0.0-beta.3",
"shelljs": "^0.8.4",
"time-stamp": "2.2.0",
"tokenize-file": "0.1.7",
"totp-generator": "0.0.9",
Expand Down
1 change: 1 addition & 0 deletions test/selenium/Onboarding/AccountLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async function AccountLevel () {
let logInPage = process.env.LOGIN_PAGE;
let Website = process.env.WEBSITE;
let step = util.getStep();
util.logHolla(logPath)


describe('AccountLevel', function() {
Expand Down
28 changes: 11 additions & 17 deletions test/selenium/Onboarding/LogIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,7 @@ async function LogIn () {
let passWord = process.env.PASSWORD;
let logInPage = process.env.LOGIN_PAGE;
let step = util.getStep();

if (process.env.NODE_ENV == 'test') {
console.log('Variables are defined');
}
// const fs = require("fs");

// require('console-stamp')(console, {
// format: ':date(yyyy/mm/dd HH:MM:ss.l)|' ,
// stdout: fs.createWriteStream(logPath+"/normalStdout.txt"),
// stderr: fs.createWriteStream(logPath+"/errStdErr.txt"),
// });


util.logHolla(logPath)

describe('BobLogIn', function() {
this.timeout(30000);
Expand All @@ -44,7 +32,7 @@ async function LogIn () {
setTimeout(resolve, ms);
});
}

function shot(){util.takeHollashot(driver,reportPath,step);}
beforeEach(async function() {
driver = await new Builder().forBrowser('chrome').build();
vars = {};
Expand Down Expand Up @@ -72,14 +60,17 @@ async function LogIn () {
console.log(step++,' | type | name=email |', userName);
await driver.wait(until.elementLocated(By.name('email')), 5000);
await driver.findElement(By.name('email')).sendKeys(userName);

shot();

console.log(step++,' | type | name=password | PASSWORD');
await driver.wait(until.elementLocated(By.name('password')), 5000);
await driver.findElement(By.name('password')).sendKeys(passWord);
shot();

console.log(step++,' | click | css=.auth_wrapper | ');
await driver.wait(until.elementIsEnabled(await driver.findElement(By.css('.auth_wrapper'))), 5000);
await driver.findElement(By.css('.auth_wrapper')).click();
shot();

console.log(step++,' | verifyElementPresent | css=.holla-button |');
{
Expand All @@ -91,12 +82,15 @@ async function LogIn () {
console.log(step++,' | click | css=.holla-button | ');
await driver.findElement(By.css('.holla-button')).click();
await sleep(5000);
shot();

//then the username should be as same as entered
console.log(step++,' | assertText | css=.app-bar-account-content > div:nth-child(2) |',userName);
await driver.wait(until.elementLocated(By.css('.app-bar-account-content > div:nth-child(2)')), 20000);
await console.log(await driver.findElement(By.css('.app-bar-account-content > div:nth-child(2)')).getText());
expect(await driver.findElement(By.css('.app-bar-account-content > div:nth-child(2)')).getText()).to.equal(userName);


shot();
console.log('This is the EndOfTest');


Expand All @@ -107,6 +101,6 @@ async function LogIn () {
}
describe('Main Test', function () {

//LogIn();
LogIn();
})
module.exports.LogIn = LogIn;
1 change: 1 addition & 0 deletions test/selenium/Onboarding/LogOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function LogOut(){
let signUpPage = process.env.SIGN_UP_PAGE;
let emailPage = process.env.EMAIL_PAGE;
let step = util.getStep();
util.logHolla(logPath)


if (process.env.NODE_ENV == 'test') {
Expand Down
1 change: 1 addition & 0 deletions test/selenium/Onboarding/Promotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async function Promotion(){
let password = process.env.PASSWORD;
const timestamp = require('time-stamp');
let step = util.getStep();
util.logHolla(logPath)


const fs = require('fs');
Expand Down
7 changes: 4 additions & 3 deletions test/selenium/Onboarding/ResendVerificationEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function ResendVerificationEmail(){
let signUpPage = process.env.SIGN_UP_PAGE;
let emailAdmin =process.env.Email_ADMIN_USERNAME;
let step = util.getStep();
util.logHolla(logPath)
if (process.env.NODE_ENV == 'test') {
console.log('Variables are defined');
}
Expand Down Expand Up @@ -58,7 +59,7 @@ async function ResendVerificationEmail(){

afterEach(async function() {
util.setStep(step);
await driver.quit();
//await driver.quit();
});
it('NewUserRequestSignUp', async function() {
await sleep(5000)
Expand Down Expand Up @@ -122,7 +123,7 @@ async function ResendVerificationEmail(){
let reuserName = util.getNewUser();

console.log('Step # | name | target | value');
await util.emailLogIn(driver,emailAdmin,passWord);
await util.emailLogIn(step,driver,emailAdmin,passWord);
await driver.wait(until.elementIsEnabled(await driver.findElement(By.css('.x-grid3-row:nth-child(1) .subject:nth-child(1) > .grid_compact:nth-child(1)'))), 50000);
await driver.findElement(By.css('.x-grid3-row:nth-child(1) .subject:nth-child(1) > .grid_compact:nth-child(1)')).click();

Expand Down Expand Up @@ -181,6 +182,6 @@ async function ResendVerificationEmail(){
}
describe('Main Test', function () {

//ResendVerificationEmail();
ResendVerificationEmail();
})
module.exports.ResendVerificationEmail = ResendVerificationEmail
5 changes: 3 additions & 2 deletions test/selenium/Onboarding/ResetPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async function ResetPassword(){
let webSite = process.env.WEBSITE;
let emailAdmin =process.env.Email_ADMIN_USERNAME;
let step = util.getStep();
util.logHolla(logPath)

if (process.env.NODE_ENV == 'test') {
console.log('Variables are defined');
Expand Down Expand Up @@ -84,7 +85,7 @@ async function ResetPassword(){
console.log('Test name: Confirmation');
console.log('Step # | name | target | value');

await util.emailLogIn(driver,emailAdmin,passWord);
await util.emailLogIn(step,driver,emailAdmin,passWord);
await driver.wait(until.elementIsEnabled(await driver.findElement(By.css('.x-grid3-row:nth-child(1) .subject:nth-child(1) > .grid_compact:nth-child(1)'))), 50000);
await driver.findElement(By.css('.x-grid3-row:nth-child(1) .subject:nth-child(1) > .grid_compact:nth-child(1)')).click();

Expand Down Expand Up @@ -145,6 +146,6 @@ async function ResetPassword(){
}
describe('Main Test', function () {

//ResetPassword();
ResetPassword();
})
module.exports.ResetPassword = ResetPassword;
7 changes: 4 additions & 3 deletions test/selenium/Onboarding/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async function SignUp(){
let signUpPage = process.env.SIGN_UP_PAGE;
let emailAdmin =process.env.Email_ADMIN_USERNAME;
let step = util.getStep();
util.logHolla(logPath)
const newUser = util.defineNewUser(User,4) ;
console.log(newUser);

Expand All @@ -43,7 +44,7 @@ async function SignUp(){

afterEach(async function() {
util.setStep(step);
await driver.quit();
// await driver.quit();
});

it('FillUpNewUserRequest', async function() {
Expand Down Expand Up @@ -88,7 +89,7 @@ async function SignUp(){
console.log('Test name: Confirmation');
console.log('Step # | name | target | value');

await util.emailLogIn(driver,emailAdmin,passWord);
await util.emailLogIn(step,driver,emailAdmin,passWord);

await driver.wait(until.elementIsEnabled(await driver.findElement(By.css('.x-grid3-row:nth-child(1) .subject:nth-child(1) > .grid_compact:nth-child(1)'))), 50000);

Expand Down Expand Up @@ -149,6 +150,6 @@ async function SignUp(){
}
describe('Main Test', function () {

//SignUp();
SignUp();
})
module.exports.SignUp = SignUp;
Loading

0 comments on commit f69c796

Please sign in to comment.