mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
[e2e] [MV3] Fix Add Account e2e flaky test for MV3 build (#16603)
* Wait until element is not present * Wait for non empty element on add account test * Wait for non empty element for all instances of get account text * Point to account value directly * Add accounts as const
This commit is contained in:
parent
121969b1a7
commit
6dddd246d1
@ -21,6 +21,8 @@ describe('Add account', function () {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
const secondAccount = '0x3ED0eE22E0685Ebbf07b2360A8331693c413CC59';
|
||||||
|
const thirdAccount = '0xD38d853771Fb546bd8B18b2F3638491bC0B0E906';
|
||||||
|
|
||||||
it('should display correct new account name after create', async function () {
|
it('should display correct new account name after create', async function () {
|
||||||
await withFixtures(
|
await withFixtures(
|
||||||
@ -80,9 +82,10 @@ describe('Add account', function () {
|
|||||||
const detailsModal = await driver.findVisibleElement('span .modal');
|
const detailsModal = await driver.findVisibleElement('span .modal');
|
||||||
// get the public address for the "second account"
|
// get the public address for the "second account"
|
||||||
await driver.waitForSelector('.qr-code__address');
|
await driver.waitForSelector('.qr-code__address');
|
||||||
const secondAccountAddress = await driver.findElement(
|
const secondAccountAddress = await driver.findElement({
|
||||||
'.qr-code__address',
|
text: secondAccount,
|
||||||
);
|
tag: 'div',
|
||||||
|
});
|
||||||
const secondAccountPublicAddress = await secondAccountAddress.getText();
|
const secondAccountPublicAddress = await secondAccountAddress.getText();
|
||||||
|
|
||||||
await driver.clickElement('.account-modal__close');
|
await driver.clickElement('.account-modal__close');
|
||||||
@ -106,9 +109,10 @@ describe('Add account', function () {
|
|||||||
'span .modal',
|
'span .modal',
|
||||||
);
|
);
|
||||||
await driver.waitForSelector('.qr-code__address');
|
await driver.waitForSelector('.qr-code__address');
|
||||||
const thirdAccountAddress = await driver.findElement(
|
const thirdAccountAddress = await driver.findElement({
|
||||||
'.qr-code__address',
|
text: thirdAccount,
|
||||||
);
|
tag: 'div',
|
||||||
|
});
|
||||||
const thirdAccountPublicAddress = await thirdAccountAddress.getText();
|
const thirdAccountPublicAddress = await thirdAccountAddress.getText();
|
||||||
|
|
||||||
await driver.clickElement('.account-modal__close');
|
await driver.clickElement('.account-modal__close');
|
||||||
@ -162,10 +166,10 @@ describe('Add account', function () {
|
|||||||
);
|
);
|
||||||
// get the public address for the "second account"
|
// get the public address for the "second account"
|
||||||
await driver.waitForSelector('.qr-code__address');
|
await driver.waitForSelector('.qr-code__address');
|
||||||
const recreatedSecondAccountAddress = await driver.findElement(
|
const recreatedSecondAccountAddress = await driver.findElement({
|
||||||
'.qr-code__address',
|
text: secondAccount,
|
||||||
);
|
tag: 'div',
|
||||||
|
});
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await recreatedSecondAccountAddress.getText(),
|
await recreatedSecondAccountAddress.getText(),
|
||||||
secondAccountPublicAddress,
|
secondAccountPublicAddress,
|
||||||
@ -188,10 +192,10 @@ describe('Add account', function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// get the public address for the "third account"
|
// get the public address for the "third account"
|
||||||
await driver.waitForSelector('.qr-code__address');
|
const recreatedThirdAccountAddress = await driver.findElement({
|
||||||
const recreatedThirdAccountAddress = await driver.findElement(
|
text: thirdAccount,
|
||||||
'.qr-code__address',
|
tag: 'div',
|
||||||
);
|
});
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
await recreatedThirdAccountAddress.getText(),
|
await recreatedThirdAccountAddress.getText(),
|
||||||
thirdAccountPublicAddress,
|
thirdAccountPublicAddress,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user