-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open correct tx details when there is a pending tx
- Loading branch information
1 parent
9d6c7f3
commit c2c840e
Showing
2 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1261,40 +1261,36 @@ const metamask = { | |
.locator(mainPageElements.tabs.activityButton) | ||
.click(); | ||
|
||
let visibleTxsCount = await playwright | ||
let visibleTxs = await playwright | ||
.metamaskWindow() | ||
.locator( | ||
`${mainPageElements.activityTab.completedTransactionsList} > div`, | ||
) | ||
.count(); | ||
.filter({ hasNotText: 'History' }) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
duckception
Author
Contributor
|
||
.filter({ hasNotText: 'View more' }) | ||
.all(); | ||
|
||
while (txIndex >= visibleTxsCount) { | ||
while (txIndex >= visibleTxs.length) { | ||
try { | ||
await playwright.metamaskWindow().getByText('View more').click(); | ||
} catch (error) { | ||
log('[openTransactionDetails] Clicking "View more" failed!'); | ||
throw new Error( | ||
`Transaction with index ${txIndex} is not found. There are only ${visibleTxsCount} transactions.`, | ||
`Transaction with index ${txIndex} is not found. There are only ${visibleTxs.length} transactions.`, | ||
); | ||
} | ||
|
||
visibleTxsCount = await playwright | ||
visibleTxs = await playwright | ||
.metamaskWindow() | ||
.locator( | ||
`${mainPageElements.activityTab.completedTransactionsList} > div`, | ||
) | ||
.count(); | ||
.filter({ hasNotText: 'History' }) | ||
.filter({ hasNotText: 'View more' }) | ||
.all(); | ||
} | ||
|
||
await playwright | ||
.metamaskWindow() | ||
.locator(mainPageElements.activityTab.completedTransaction(txIndex)) | ||
.waitFor({ state: 'visible', timeout: 10000 }); | ||
|
||
await playwright | ||
.metamaskWindow() | ||
.locator(mainPageElements.activityTab.completedTransaction(txIndex)) | ||
.click(); | ||
await visibleTxs[txIndex].click(); | ||
|
||
await playwright | ||
.metamaskWindow() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@duckception We're trying to avoid using text-based selectors to be able to support multiple languages of metamask. You won't find them anywhere in the code because of it.