1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix flaky account removal e2e test (#12607)

* Add delay to fix flaky account removal e2e test

* Await for element to update instead of awaiting an arbitrary delay

* Update test/e2e/tests/from-import-ui.spec.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* code formatting

* Remove redundant code

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
This commit is contained in:
Dan J Miller 2021-11-10 06:30:42 -03:30 committed by GitHub
parent a49a40fbbb
commit a13d8583a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,10 +233,15 @@ describe('Metamask Import UI', function () {
// should remove the account
await driver.clickElement({ text: 'Remove', tag: 'button' });
const currentActiveAccountName = await driver.findElement(
'.selected-account__name',
// Wait until selected account switches away from removed account to first account
await driver.waitForSelector(
{
css: '.selected-account__name',
text: 'Account 1',
},
{ timeout: 10000 },
);
assert.equal(await currentActiveAccountName.getText(), 'Account 1');
await driver.delay(regularDelayMs);
await driver.clickElement('.account-menu__icon');