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

add e2e test for editing and deleting contact from address book #16014

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

mirjanaKukic
Copy link
Contributor

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:

  1. Edit entry in address book
  2. Adds an entry to address book and deletes it from address book

Pre-Merge Checklist

  • PR template is filled out
  • IF this PR fixes a bug, a test that would have caught the bug has been added
  • PR is linked to the appropriate GitHub issue
  • PR has been added to the appropriate release Milestone

+ If there are functional changes:

  • Manual testing complete & passed
  • "Extension QA Board" label has been applied

@mirjanaKukic mirjanaKukic added PS-team PS MM extension team issues needs-qa Label will automate into QA workspace labels Sep 28, 2022
@mirjanaKukic mirjanaKukic self-assigned this Sep 28, 2022
@github-actions
Copy link
Contributor

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.

@metamaskbot
Copy link
Collaborator

Builds ready [3bee489]
Page Load Metrics (2427 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint92143112136
domContentLoaded19642705239817685
load19642706242718689
domInteractive19642705239817685


await driver.clickElement({ text: 'Edit', tag: 'button' });
const inputUsername = await driver.findElement('#nickname');
await inputUsername.clear();
Copy link
Contributor

@PeterYinusa PeterYinusa Sep 29, 2022

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// adding new account
await driver.clickElement({ text: 'Add contact', tag: 'button' });
const inputUsername = await driver.findElement('#nickname');
await inputUsername.clear();
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 above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

PeterYinusa
PeterYinusa previously approved these changes Sep 29, 2022
'.send__select-recipient-wrapper__group-item',
);
assert.equal(contacts.length, 1);
// adding new account
Copy link
Contributor

@seaona seaona Sep 30, 2022

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@mirjanaKukic mirjanaKukic force-pushed the e2e/editing-deleting-contact branch from 209ad3c to faa3fdd Compare September 30, 2022 14:31
@mirjanaKukic mirjanaKukic marked this pull request as ready for review September 30, 2022 14:31
@mirjanaKukic mirjanaKukic requested a review from a team as a code owner September 30, 2022 14:31
@mirjanaKukic mirjanaKukic force-pushed the e2e/editing-deleting-contact branch from faa3fdd to cdb4394 Compare October 3, 2022 07:13
@metamaskbot
Copy link
Collaborator

Builds ready [cdb4394]
Page Load Metrics (2226 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint952218215460221
domContentLoaded18322435220115373
load18322466222616378
domInteractive18322435220115373

seaona
seaona previously approved these changes Oct 6, 2022
PeterYinusa
PeterYinusa previously approved these changes Oct 6, 2022
@mirjanaKukic mirjanaKukic dismissed stale reviews from PeterYinusa and seaona via df1ef24 November 2, 2022 10:03
@mirjanaKukic mirjanaKukic force-pushed the e2e/editing-deleting-contact branch from cdb4394 to df1ef24 Compare November 2, 2022 10:03
@metamaskbot
Copy link
Collaborator

Builds ready [f56b659]
Page Load Metrics (2183 ± 124 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint901641082010
domContentLoaded166128312164244117
load168029132183258124
domInteractive166128312164244117

@mirjanaKukic mirjanaKukic force-pushed the e2e/editing-deleting-contact branch from f56b659 to 940ef46 Compare November 2, 2022 12:11
@metamaskbot
Copy link
Collaborator

Builds ready [940ef46]
Page Load Metrics (2140 ± 122 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint952403237498239
domContentLoaded168025412131255122
load168025412140255122
domInteractive168025412131255122

Copy link
Contributor

@seaona seaona left a comment

Choose a reason for hiding this comment

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

LGTM

@PeterYinusa PeterYinusa merged commit 95dcf07 into develop Nov 2, 2022
@PeterYinusa PeterYinusa deleted the e2e/editing-deleting-contact branch November 2, 2022 14:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-qa Label will automate into QA workspace PS-team PS MM extension team issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e tests for editing and deleting contacts
4 participants