mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
[E2E] Fixes to try to deflake Snaps E2E tests (#17123)
* added delays in several places * fix to update test
This commit is contained in:
parent
e236792a90
commit
f2da79f563
@ -36,6 +36,7 @@ describe('Test Snap bip-32', function () {
|
||||
await driver.scrollToElement(snapButton1);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectBip32');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -79,6 +80,9 @@ describe('Test Snap bip-32', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// switch back to test-snaps window
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -30,10 +30,12 @@ describe('Test Snap bip-44', function () {
|
||||
|
||||
// navigate to test snaps page and connect
|
||||
await driver.driver.get(TEST_SNAPS_WEBSITE_URL);
|
||||
await driver.delay(1000);
|
||||
const snapButton1 = await driver.findElement('#connectBip44Snap');
|
||||
await driver.scrollToElement(snapButton1);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectBip44Snap');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -77,6 +79,9 @@ describe('Test Snap bip-44', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// click send inputs on test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -30,10 +30,12 @@ describe('Test Snap Confirm', function () {
|
||||
|
||||
// navigate to test snaps page and connect
|
||||
await driver.driver.get(TEST_SNAPS_WEBSITE_URL);
|
||||
await driver.delay(1000);
|
||||
const snapButton1 = await driver.findElement('#connectConfirmSnap');
|
||||
await driver.scrollToElement(snapButton1);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectConfirmSnap');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -66,6 +68,9 @@ describe('Test Snap Confirm', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// switch back to test snaps page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -30,10 +30,12 @@ describe('Test Snap Error', function () {
|
||||
|
||||
// navigate to test snaps page and connect
|
||||
await driver.openNewPage(TEST_SNAPS_WEBSITE_URL);
|
||||
await driver.delay(1000);
|
||||
const snapButton = await driver.findElement('#connectErrorSnap');
|
||||
await driver.scrollToElement(snapButton);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectErrorSnap');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -67,6 +69,9 @@ describe('Test Snap Error', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// click send inputs on test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -34,6 +34,7 @@ describe('Test Snap Installed', function () {
|
||||
const confirmButton = await driver.findElement('#connectConfirmSnap');
|
||||
await driver.scrollToElement(confirmButton);
|
||||
await driver.clickElement('#connectConfirmSnap');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -66,6 +67,9 @@ describe('Test Snap Installed', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// click send inputs on test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
@ -102,6 +106,9 @@ describe('Test Snap Installed', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
||||
|
@ -30,12 +30,14 @@ describe('Test Snap Management', function () {
|
||||
|
||||
// open a new tab and navigate to test snaps page and connect
|
||||
await driver.openNewPage(TEST_SNAPS_WEBSITE_URL);
|
||||
await driver.delay(1000);
|
||||
|
||||
// find and scroll to the correct card and click first
|
||||
const snapButton = await driver.findElement('#connectNotification');
|
||||
await driver.scrollToElement(snapButton);
|
||||
await driver.delay(500);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectNotification');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -68,6 +70,9 @@ describe('Test Snap Management', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// switch to the original MM tab
|
||||
const extensionPage = windowHandles[0];
|
||||
await driver.switchToWindow(extensionPage);
|
||||
|
@ -38,6 +38,7 @@ describe('Test Snap manageState', function () {
|
||||
await driver.scrollToElement(snapButton1);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectManageState');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -69,6 +70,9 @@ describe('Test Snap manageState', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// fill and click send inputs on test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -35,8 +35,9 @@ describe('Test Snap Notification', function () {
|
||||
// find and scroll down to snapId5 and connect
|
||||
const snapButton = await driver.findElement('#connectNotification');
|
||||
await driver.scrollToElement(snapButton);
|
||||
await driver.delay(500);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectNotification');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -69,6 +70,9 @@ describe('Test Snap Notification', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// click send inputs on test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(2, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
@ -36,6 +36,7 @@ describe('Test Snap TxInsights', function () {
|
||||
await driver.scrollToElement(snapButton1);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectInsightsSnap');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
let windowHandles = await driver.waitUntilXWindowHandles(
|
||||
@ -55,6 +56,7 @@ describe('Test Snap TxInsights', function () {
|
||||
10000,
|
||||
);
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// switch to metamask extension
|
||||
|
@ -30,13 +30,13 @@ describe('Test Snap update', function () {
|
||||
|
||||
// open a new tab and 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('#connectUpdateNew');
|
||||
const snapButton = await driver.findElement('#connectUpdate');
|
||||
await driver.scrollToElement(snapButton);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectUpdate');
|
||||
|
||||
await driver.delay(2000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
@ -78,6 +78,9 @@ describe('Test Snap update', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// navigate to test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
@ -88,6 +91,7 @@ describe('Test Snap update', function () {
|
||||
await driver.scrollToElement(snapButton2);
|
||||
await driver.delay(1000);
|
||||
await driver.clickElement('#connectUpdateNew');
|
||||
await driver.delay(1000);
|
||||
|
||||
// switch to metamask extension and click connect
|
||||
await driver.waitUntilXWindowHandles(2, 1000, 10000);
|
||||
@ -104,6 +108,9 @@ describe('Test Snap update', function () {
|
||||
tag: 'button',
|
||||
});
|
||||
|
||||
// delay for npm installation
|
||||
await driver.delay(2000);
|
||||
|
||||
// navigate to test snap page
|
||||
windowHandles = await driver.waitUntilXWindowHandles(1, 1000, 10000);
|
||||
await driver.switchToWindowWithTitle('Test Snaps', windowHandles);
|
||||
|
Loading…
Reference in New Issue
Block a user