Skip to content

Commit

Permalink
Remove text based locators
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Sep 9, 2023
1 parent 1b11bb0 commit b6637c1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -1266,13 +1266,19 @@ const metamask = {
.locator(
`${mainPageElements.activityTab.completedTransactionsList} > div`,
)
.filter({ hasNotText: 'History' })
.filter({ hasNotText: 'View more' })
.filter({
has: playwright.metamaskWindow().locator('div.list-item__heading'),
})
.all();

while (txIndex >= visibleTxs.length) {
try {
await playwright.metamaskWindow().getByText('View more').click();
await playwright
.metamaskWindow()
.locator(
`${mainPageElements.activityTab.completedTransactionsList} > button`,
)
.click();
} catch (error) {
log('[openTransactionDetails] Clicking "View more" failed!');
throw new Error(
Expand All @@ -1285,8 +1291,9 @@ const metamask = {
.locator(
`${mainPageElements.activityTab.completedTransactionsList} > div`,
)
.filter({ hasNotText: 'History' })
.filter({ hasNotText: 'View more' })
.filter({
has: playwright.metamaskWindow().locator('div.list-item__heading'),
})
.all();
}

Expand Down

0 comments on commit b6637c1

Please sign in to comment.