diff --git a/test/e2e/snaps/test-snap-bip-32.spec.js b/test/e2e/snaps/test-snap-bip-32.spec.js index 6cffbbb4e..89fab0c12 100644 --- a/test/e2e/snaps/test-snap-bip-32.spec.js +++ b/test/e2e/snaps/test-snap-bip-32.spec.js @@ -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);