Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close new network popup after switching networks #842

Merged
merged 2 commits into from
Aug 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 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,10 @@ const metamask = {
notificationPage,
{ waitForEvent: 'close' },
);

// TODO: Add test for the new network popup. Requires changes to the MetaMask Test Dapp.
await module.exports.closePopupAndTooltips();

return true;
},
async rejectToSwitchNetwork() {
Expand Down