From d57e4621ec370dfa11628183232d6580ce1060b5 Mon Sep 17 00:00:00 2001 From: Sero <69639595+Seroxdesign@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:24:35 -0400 Subject: [PATCH] test locator exists theory --- .../metamask/src/pages/NotificationPage/page.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/wallets/metamask/src/pages/NotificationPage/page.ts b/wallets/metamask/src/pages/NotificationPage/page.ts index 7ca06f7d2..84de0a4b4 100644 --- a/wallets/metamask/src/pages/NotificationPage/page.ts +++ b/wallets/metamask/src/pages/NotificationPage/page.ts @@ -32,20 +32,9 @@ export class NotificationPage { private async beforeMessageSignature(extensionId: string) { const notificationPage = await getNotificationPageAndWaitForLoad(this.page.context(), extensionId) - const scrollDownButton = notificationPage.locator(Selectors.SignaturePage.structuredMessage.scrollDownButton) - - let isScrollButtonVisible = false - - const scrollButtonPromise = scrollDownButton - .waitFor({ state: 'visible' }) - .then(async () => { - isScrollButtonVisible = true - await scrollDownButton.click() - return true - }) - .catch(() => false) - - await Promise.race([scrollButtonPromise, notificationPage.waitForLoadState('load').then(() => false)]) + notificationPage.waitForLoadState('load') + const isScrollButtonVisible = + (await notificationPage.locator(Selectors.SignaturePage.structuredMessage.scrollDownButton).count()) > 0 return { notificationPage,