Skip to content

Commit

Permalink
test locator exists theory
Browse files Browse the repository at this point in the history
  • Loading branch information
Seroxdesign committed Jun 19, 2024
1 parent 4d856a4 commit d57e462
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions wallets/metamask/src/pages/NotificationPage/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d57e462

Please sign in to comment.