-
Notifications
You must be signed in to change notification settings - Fork 5k
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
add e2e test for editing and deleting contact from address book #16014
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [3bee489]
Page Load Metrics (2427 ± 89 ms)
|
test/e2e/tests/address-book.spec.js
Outdated
|
||
await driver.clickElement({ text: 'Edit', tag: 'button' }); | ||
const inputUsername = await driver.findElement('#nickname'); | ||
await inputUsername.clear(); |
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 don't think we need to use the clear
method, as the fill
method that follows also clears the input under the hood.
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.
Done
test/e2e/tests/address-book.spec.js
Outdated
// adding new account | ||
await driver.clickElement({ text: 'Add contact', tag: 'button' }); | ||
const inputUsername = await driver.findElement('#nickname'); | ||
await inputUsername.clear(); |
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 above
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.
Done
test/e2e/tests/address-book.spec.js
Outdated
'.send__select-recipient-wrapper__group-item', | ||
); | ||
assert.equal(contacts.length, 1); | ||
// adding new account |
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.
Since we are using fixtures, I suggest to skip the part of adding a new contact, since it's already there. So we just test that the Delete function works, as the Add Contact function has already been tested on the first it
block.
So you could remove from line 193
to line 206
and on line 208
look for Test Name 1
instead of Test Name 2
await driver.clickElement({ text: 'Test Name 1', tag: 'div' });
await driver.clickElement({ text: 'Edit', tag: 'button' });
await driver.clickElement({ text: 'Delete account', tag: 'a' });
// it checks if account is deleted
// now there should be no contacts in the list so we can check that Element is not Present
assert.equal(await driver.isElementPresent(...), false);
The it
block could then be re-written something like Deletes existing entry from address book
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.
Done
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.
LGTM!
209ad3c
to
faa3fdd
Compare
faa3fdd
to
cdb4394
Compare
Builds ready [cdb4394]
Page Load Metrics (2226 ± 78 ms)
|
cdb4394
to
df1ef24
Compare
Builds ready [f56b659]
Page Load Metrics (2183 ± 124 ms)
|
f56b659
to
940ef46
Compare
lint fix fix added fixture builder
Builds ready [940ef46]
Page Load Metrics (2140 ± 122 ms)
|
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.
LGTM
Explanation
Added new tests in address-book.spec.js file for editing and deleting contacts from address book
Resolves #13500
Manual Testing Steps
Run testcase locally or check ci pipeline and ensure that it continues to work normally:
yarn test:e2e:single test/e2e/tests/address-book.spec.js
Added tests are inside two it blocks:
Pre-Merge Checklist
+ If there are functional changes: