From 5b27216049c44e4940b172480a19f1df151a22b3 Mon Sep 17 00:00:00 2001 From: david0xd Date: Mon, 24 Jun 2024 13:19:18 +0200 Subject: [PATCH] Try fixing failing e2e tests --- test/e2e/accounts/common.ts | 10 ++++++ test/e2e/accounts/create-snap-account.spec.ts | 33 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/test/e2e/accounts/common.ts b/test/e2e/accounts/common.ts index f4039d6b6533..406e23d0e6cc 100644 --- a/test/e2e/accounts/common.ts +++ b/test/e2e/accounts/common.ts @@ -78,6 +78,16 @@ export async function installSnapSimpleKeyring( tag: 'button', }); + // wait for permissions popover, click checkboxes and confirm + await driver.waitForSelector('.mm-checkbox__input'); + await driver.clickElement('.mm-checkbox__input'); + await driver.waitForSelector( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.clickElement( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.waitForSelector({ text: 'OK' }); await driver.clickElement({ diff --git a/test/e2e/accounts/create-snap-account.spec.ts b/test/e2e/accounts/create-snap-account.spec.ts index ab34ac0046c0..fb14c5abfdd5 100644 --- a/test/e2e/accounts/create-snap-account.spec.ts +++ b/test/e2e/accounts/create-snap-account.spec.ts @@ -42,6 +42,17 @@ describe('Create Snap Account', function (this: Suite) { text: 'Confirm', tag: 'button', }); + + // wait for permissions popover, click checkboxes and confirm + await driver.waitForSelector('.mm-checkbox__input'); + await driver.clickElement('.mm-checkbox__input'); + await driver.waitForSelector( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.clickElement( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.waitForSelector({ text: 'OK' }); await driver.clickElement({ text: 'OK', @@ -121,6 +132,17 @@ describe('Create Snap Account', function (this: Suite) { text: 'Confirm', tag: 'button', }); + + // wait for permissions popover, click checkboxes and confirm + await driver.waitForSelector('.mm-checkbox__input'); + await driver.clickElement('.mm-checkbox__input'); + await driver.waitForSelector( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.clickElement( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.waitForSelector({ text: 'OK' }); await driver.clickElement({ text: 'OK', @@ -213,6 +235,17 @@ describe('Create Snap Account', function (this: Suite) { text: 'Confirm', tag: 'button', }); + + // wait for permissions popover, click checkboxes and confirm + await driver.waitForSelector('.mm-checkbox__input'); + await driver.clickElement('.mm-checkbox__input'); + await driver.waitForSelector( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.clickElement( + '[data-testid="snap-install-warning-modal-confirm"]', + ); + await driver.waitForSelector({ text: 'OK' }); await driver.clickElement({ text: 'OK',