Skip to content

Commit

Permalink
chore: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz committed Oct 16, 2024
1 parent bc3cd6b commit 54fcdee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/utils/metamask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 54fcdee

Please sign in to comment.