Skip to content

Commit

Permalink
Close new network popup after switching to it for the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Aug 18, 2023
1 parent c092400 commit 59e484c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ const metamask = {
mainPageElements.actionableMessage.closeButton,
);
}

// Closes "You have switched to [network]" popup.
// It appears if you connect to a new network for the first time.
if (
(await playwright
.metamaskWindow()
.locator(recipientPopupElements.popupCloseButton)
.count()) > 0
) {
await playwright.waitAndClick(recipientPopupElements.popupCloseButton);
}

return true;
},
async closeModal() {
Expand Down Expand Up @@ -1219,6 +1231,7 @@ const metamask = {
notificationPage,
{ waitForEvent: 'close' },
);
await module.exports.closePopupAndTooltips();
return true;
},
async rejectToSwitchNetwork() {
Expand Down

0 comments on commit 59e484c

Please sign in to comment.