Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

VasilyKuznetsov
Copy link

UI autotests fixes + new locators. Due to changes in ui and logic tests were broken.

@jenkinss-github
Copy link

Can one of the admins verify this patch?

@VasilyKuznetsov VasilyKuznetsov changed the title {feature} e2e test [feature] e2e test fixes Oct 1, 2018
@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "qa-" prefix everywhere

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -178,6 +178,7 @@ class Login extends Component {
/>
<i
className="form-text__icon form-text__icon--eye form-text__icon--eye_open"
id="showpasswordbutton"
Copy link
Contributor

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"

Copy link
Author

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"
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -200,6 +202,7 @@ class Login extends Component {
<div className="home__restore-block">
<button
type="button"
id="recovery"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -223,6 +226,7 @@ class Login extends Component {
<span className={disabled ? "disabled" : ""}>I don’t have an account.</span>
<button
type="button"
id="signup"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous

Copy link
Author

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Author

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

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);
Copy link
Contributor

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

Copy link
Author

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",
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug leftovers, fixed

@boodyvo boodyvo changed the title [feature] e2e test fixes [FEATURE] e2e test fixes Oct 1, 2018
@@ -213,7 +215,6 @@ const afterTestClear = (params) => {
process.kill(btcdPid);
process.kill(fundsLndPid);
rimraf.sync(params.userPath);
Copy link
Contributor

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);
    }

config.timeoutForElementChecks,
);
const error = await app.client.getText(".form-error");
assert.equal(error, "Only letters and numbers are allowed.");
Copy link
Contributor

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

async () => app.client.isExisting(".form-error"),
config.timeoutForElementChecks,
);
assert.equal(error, "Only letters and numbers are allowed.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

config.timeoutForElementChecks,
);
const error = await app.client.getText(".form-error");
assert.equal(error, "Must contain digit, uppercase and lowercase letter.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

async () => app.client.isExisting(".form-error"),
config.timeoutForElementChecks,
);
assert.equal(error, "Must contain digit, uppercase and lowercase letter.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

config.timeoutForElementChecks,
);
const error = await app.client.getText(".form-error");
assert.equal(error, "Invalid length. Minimum allowed length is 8 characters.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

config.timeoutForElementChecks,
);
const error = await app.client.getText(".form-error");
assert.equal(error, "Password mismatch.");
Copy link
Contributor

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(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");
Copy link
Contributor

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");
Copy link
Contributor

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";
Copy link
Contributor

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",
Copy link
Contributor

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");
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor

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");
Copy link
Contributor

@serhiislobodian serhiislobodian Oct 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same about console.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants