-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] e2e test fixes #16
base: master
Are you sure you want to change the base?
[FEATURE] e2e test fixes #16
Conversation
Can one of the admins verify this patch? |
@@ -69,6 +69,7 @@ class CloseChannel extends Component { | |||
className="button button__link text-uppercase" | |||
onClick={this.closeModal} | |||
disabled={this.state.processing} | |||
id="qa-cancel-close-channel-modal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "qa-" prefix everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
frontend/components/login/index.js
Outdated
@@ -178,6 +178,7 @@ class Login extends Component { | |||
/> | |||
<i | |||
className="form-text__icon form-text__icon--eye form-text__icon--eye_open" | |||
id="showpasswordbutton" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All style of naming should be the same. Use kebab-case, so it would be "show-password-button"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -186,6 +187,7 @@ class Login extends Component { | |||
<div className="row form-row form-row__footer"> | |||
<div className="col-xs-12"> | |||
<button | |||
id="submit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submit => "submit-button", name in the same logical style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
frontend/components/login/index.js
Outdated
@@ -200,6 +202,7 @@ class Login extends Component { | |||
<div className="home__restore-block"> | |||
<button | |||
type="button" | |||
id="recovery" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
frontend/components/login/index.js
Outdated
@@ -223,6 +226,7 @@ class Login extends Component { | |||
<span className={disabled ? "disabled" : ""}>I don’t have an account.</span> | |||
<button | |||
type="button" | |||
id="signup" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
package.json
Outdated
@@ -27,6 +27,7 @@ | |||
"scss:watch": "npm run scss -- --watch", | |||
"test": "npm run lint && npm run test:unit -- ", | |||
"test:e2e": "cross-env NODE_ENV=spectron mocha --opts ./test/mocha.opts ./test/e2e", | |||
"test:sanity": "cross-env NODE_ENV=spectron mocha --opts ./test/mocha.opts ./test/sanity", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftovers from my future plans, fixed
test/e2e/index.js
Outdated
const licenseExists = await app.client.isExisting(".license__text"); | ||
assert.equal(licenseExists, true, "license should exists"); | ||
}); | ||
|
||
it("should proceed with eula", async () => { | ||
await app.client.click(".js-agreement"); | ||
await app.client.click("#agreement-submit"); | ||
await app.client.click("#submitbutton"); | ||
await utils.sleep(3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use named consts from config instead of 3000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
package.json
Outdated
@@ -97,6 +98,7 @@ | |||
"babel-preset-stage-0": "^6.24.1", | |||
"babel-runtime": "^6.23.0", | |||
"chai": "^3.5.0", | |||
"chai-as-promised": "^5.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, provide for all additional dependencies info why do we need it and where is it used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug leftovers, fixed
test/e2e/utilities.js
Outdated
@@ -213,7 +215,6 @@ const afterTestClear = (params) => { | |||
process.kill(btcdPid); | |||
process.kill(fundsLndPid); | |||
rimraf.sync(params.userPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to add check existance of folder, so maybe need to wrap rimraf
in something like
if (fs.existsSync(params.userPath)) {
rimraf.sync(params.userPath);
}
test/e2e/index.js
Outdated
config.timeoutForElementChecks, | ||
); | ||
const error = await app.client.getText(".form-error"); | ||
assert.equal(error, "Only letters and numbers are allowed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables from config/status-codes should be used here (as for all other places) for proper exception handling and storing
test/e2e/index.js
Outdated
async () => app.client.isExisting(".form-error"), | ||
config.timeoutForElementChecks, | ||
); | ||
assert.equal(error, "Only letters and numbers are allowed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
test/e2e/index.js
Outdated
config.timeoutForElementChecks, | ||
); | ||
const error = await app.client.getText(".form-error"); | ||
assert.equal(error, "Must contain digit, uppercase and lowercase letter."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
test/e2e/index.js
Outdated
async () => app.client.isExisting(".form-error"), | ||
config.timeoutForElementChecks, | ||
); | ||
assert.equal(error, "Must contain digit, uppercase and lowercase letter."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
test/e2e/index.js
Outdated
config.timeoutForElementChecks, | ||
); | ||
const error = await app.client.getText(".form-error"); | ||
assert.equal(error, "Invalid length. Minimum allowed length is 8 characters."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
test/e2e/index.js
Outdated
config.timeoutForElementChecks, | ||
); | ||
const error = await app.client.getText(".form-error"); | ||
assert.equal(error, "Password mismatch."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
test/e2e/index.js
Outdated
await app.client.click(loginScreen.signin); | ||
await app.client.waitForVisible(".notification-message"); | ||
const loginError = await app.client.getText(".notification-message"); | ||
assert.equal(loginError, "Incorrect username or password.", "should incorrect password error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
await app.client.click(registrationScreen.registrationNextButton); | ||
await app.client.waitForVisible(".notification-message"); | ||
const loginError = await app.client.getText(".notification-message"); | ||
assert.equal(loginError, "User already exist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Plus check the rest code
@@ -1,6 +1,14 @@ | |||
const username = "testUsername"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be better to separate config into different files by screens as for variables, because it might become unreadable due to size
@@ -131,6 +131,7 @@ | |||
"electron-is-dev": "^0.3.0", | |||
"electron-updater": "^3.1.2", | |||
"event-stream": "^3.3.4", | |||
"exec": "^0.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used anywhere in codebase?
); | ||
const error = await app.client.getText(registrationScreen.errorForm); | ||
assert.equal(error, statusCodes.EXCEPTION_USERNAME_WRONG_FORMAT(0, 0)); | ||
console.log("Checked username with space"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use such structure here: remove console.log and use it() test wrapper arrond necessary assert to substitute it. Afterwards it("TC:564:..) will become describe("TC:564...) block
assert.equal(seedVerifyExists, true, "should show seed verify form"); | ||
}); | ||
|
||
it("TC:567: Return possibility to seed words generation", async () => { | ||
await app.client.click(seedConfirmationScreen.backButtonId); | ||
await app.client.waitUntil(async () => app.client.isExisting("#seed"), config.timeoutForElementChecks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep same style everywhere. Substitute id with const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check everywhere
await app.client.setValue("#verify-seed", config.randomSeed); | ||
await app.client.click("button=Sign up"); | ||
await app.client.click(seedConfirmationScreen.seedConfirmationNextButton); | ||
console.log("Pressed Next"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same about console.log
UI autotests fixes + new locators. Due to changes in ui and logic tests were broken.