After adding new network and switching to it metamask shows additional message which prevents further interactions
domalaq opened this issue · comments
So I call a method cy.allowMetamaskToAddAndSwitchNetwork();
which does its job well and network is added and switched. But Metamask shows a modal message with title "You have switched to BNB (for example). Things to keep in mind ..." and button "Got it". And this message is not dismissed. And further operation like cy.disconnectMetamaskWalletFromDapp();
can not be successfully executed.
Expected behavior
Modal message should be closed.
Desktop (please complete the following information):
- OS: Pop_OS! 22.04
- Synpress version: 3.7.0
- CI platform (if applicable): local testing
Also if someone can suggest a workaround would be much appreciated.
Hey @domalaq please share the way you are calling the cy.allowMetamaskToAddAndSwitchNetwork() method so I can reproduce it and see if can share a solution.
Hey @domalaq please share the way you are calling the cy.allowMetamaskToAddAndSwitchNetwork() method so I can reproduce it and see if can share a solution.
I got it, was able to reproduce, looking at a possible solution.
Ok I found that usual allowNetworkToSwitch()
is broken now. It tries to find additional popup but fails. I think there should be some condition like if there is additional popup then close otherwise proceed.
Ok I found that usual
allowNetworkToSwitch()
is broken now. It tries to find additional popup but fails. I think there should be some condition like if there is additional popup then close otherwise proceed.
yeah makes sense, will push the new version today.
Your new changes didn't work. I looked at your code and tried this snippet locally which worked:
if ((await playwright
.metamaskWindow()
.locator(recipientPopupElements.popupCloseButton)
.count()) > 0) {
await playwright.waitAndClick(
recipientPopupElements.popupCloseButton,
)
}
Also I think GotItButton is not needed to be declared. You don't use it anyway.
Looking forward to your working code! Thanks for contributing on this.
Hey @domalaq @juantor16, the version with the fix for this is available under @synthetixio/synpress@3.7.2-beta.4
!