synpress
synpress copied to clipboard
`changeMetamaskNetwork` should silently skip switching to current network
Describe the bug
A clear and concise description of what the bug is.
When metamask is already on a certain network (e.g. Sepolia), and cy.changeMetamaskNetwork('Sepolia test network')
is called again, it throws an error
To Reproduce Steps to reproduce the behavior:
-
cy.acceptMetamaskAccess()
-
cy.changeMetamaskNetwork('Sepolia test network')
-
cy.changeMetamaskNetwork('Sepolia test network')
Expected behavior
A clear and concise description of what you expected to happen.
changeMetamaskNetwork
should silently skip attempting to switch to the same network
Screenshots
If applicable, add screenshots to help explain your problem.
CypressError
cy.task('changeMetamaskNetwork') failed with the following error:
> locator.click: Error: strict mode violation: locator('text=sepolia test network') resolved to 2 elements:
1) <span class="box box--margin-top-1 box--margin-bottom-…>Sepolia test network</span> aka getByTestId('network-display')
2) <span class="network-name-item" data-testid="sepolia-n…>Sepolia test network</span> aka getByTestId('sepolia-network-item')
=========================== logs ===========================
waiting for locator('text=sepolia test network')
============================================================
https://on.cypress.io/api/task
Desktop (please complete the following information):
- OS: macOS Monterey
- Synpress version: 3.5.1
- CI platform (if applicable): locally
Thanks for submitting this issue @fionnachan!
This issue is finally merged, and you can take a look at the fix here #737, and help in the review! feel free to test it!
Note: this issue will be closed once the PR is merged and the fix is confirmed