From 54fcdee660ad327e8ac132396650ee8b40da7976 Mon Sep 17 00:00:00 2001 From: Sarah Schwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:38:44 -0600 Subject: [PATCH] chore: debug --- tests/utils/metamask.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/utils/metamask.ts b/tests/utils/metamask.ts index 87bb03a5..06104883 100644 --- a/tests/utils/metamask.ts +++ b/tests/utils/metamask.ts @@ -26,12 +26,19 @@ async function clickScrollDownButton(page: Page) { await page.locator(`div[data-testid='signature-request-scroll-button']`).click(); } +const findNotificationPage = (p: Page) => { + console.log('URL:', p.url()); + return p.url().includes('/notification.html'); +}; + async function getWalletPage(context: BrowserContext) { const pages = context.pages(); - let walletPage = pages.find((p: Page) => p.url().includes('/notification.html')); + console.log('GOT ALL PAGES'); + let walletPage = pages.find(findNotificationPage); if (!walletPage) { + console.log('NO WALLET PAGE...WAITING FOR PAGE EVENT'); walletPage = await context.waitForEvent('page', { - predicate: (page: Page) => page.url().includes('/notification.html'), + predicate: findNotificationPage, }); } return walletPage;