1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

[FLASK] Fix flaky BIP-32 E2E test (#16255)

This commit is contained in:
Frederik Bolding 2022-10-24 13:49:41 +02:00 committed by GitHub
parent 8075a39567
commit 359f782e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,8 +25,9 @@ describe('Test Snap bip-32', function () {
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
// open a new tab and navigate to test snaps page and connect
await driver.openNewPage(TEST_SNAPS_WEBSITE_URL);
// navigate to test snaps page and connect
await driver.driver.get(TEST_SNAPS_WEBSITE_URL);
await driver.delay(1000);
// find and scroll to the correct card and click first
const snapButton = await driver.findElement('#sendUpdateHello');
@ -36,7 +37,7 @@ describe('Test Snap bip-32', function () {
await driver.clickElement('#connectBip32');
// switch to metamask extension and click connect
await driver.waitUntilXWindowHandles(3, 5000, 10000);
await driver.waitUntilXWindowHandles(2, 5000, 10000);
let windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
'MetaMask Notification',
@ -50,9 +51,10 @@ describe('Test Snap bip-32', function () {
10000,
);
await driver.delay(1000);
await driver.delay(2000);
// approve install of snap
await driver.waitUntilXWindowHandles(2, 5000, 10000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle(
'MetaMask Notification',
@ -73,7 +75,7 @@ describe('Test Snap bip-32', function () {
});
// switch back to test-snaps window
await driver.waitUntilXWindowHandles(2, 5000, 10000);
await driver.waitUntilXWindowHandles(1, 5000, 10000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
@ -94,7 +96,7 @@ describe('Test Snap bip-32', function () {
tag: 'button',
});
await driver.waitUntilXWindowHandles(2, 5000, 10000);
await driver.waitUntilXWindowHandles(1, 5000, 10000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
@ -124,7 +126,7 @@ describe('Test Snap bip-32', function () {
tag: 'button',
});
await driver.waitUntilXWindowHandles(2, 5000, 10000);
await driver.waitUntilXWindowHandles(1, 5000, 10000);
windowHandles = await driver.getAllWindowHandles();
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);