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

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

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions test/e2e/snaps/test-snap-bip-32.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down