-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Broken metamask.confirmTransaction on Synpress + Playwright #795
Comments
@norswap thanks for report, will investigate today |
I was also facing the same issue while trying to reject the tx. It seems its getting stuck at |
@norswap Adding an explicit wait of 10 sec before attempting to accept or reject tx seems to fix the issue for now while |
hi @norswap, i was able to set everything up on my mac, but i'm stuck on connect wallet button. anvil is running in background, metamask succesfully switched to localhost with e2e tests. any ideas? |
@norswap Could you tell me where to make that 10-second wait and how to do it ( I'm having the same issue, and I'm trying to figure out how to apply the workaround you mention. Thank you. |
Same issue here. |
something like this in |
@r3kt-eth Hey! Sorry for the delay, was on holiday. I was able to reprod, it's due to a now-fixed a bug in wagmi. Fixed on new master. Anyhow, updated to new version, and now all my tests work flawlessly. In case it helps, here's the commit that updates the versions: 0xFableOrg/0xFable@c684116 One issue I'm encountering (might have been there before) is that I consider the issue resolved, feel free to either close or keep open if you want to discuss the remaining issue (which doesn't bother me too much given the workaround is so easy). |
@ayushrungta8 Thanks for your response I tried the workaround and it didn't work unfortunately .. in my case if I resize the metamask notification it's working (see the video for more context) .. Screencast.from.2023-07-17.03-30-44.online-video-cutter.com.mp4e context) .. Do you have any ideas about what's going on .. pinging @norswap @r3kt-eth Thank you |
I never faced this resize issue. For me the popup was clearly visible throughout. |
Thank you for your response @ayushrungta8. My code: cy.contains("Approve").click();
cy.wait(2000);
cy.switchToMetamaskWindow();
cy.confirmMetamaskDataSignatureRequest().should('be.true');
cy.wait(1000);
cy.switchToCypressWindow();
cy.contains("Buy").click();
cy.wait(2000);
cy.switchToMetamaskWindow()
cy.confirmMetamaskTransaction().then( ({confirmed}) => {
expect(confirmed).to.be.true;
})
cy.wait(1000);
cy.switchToCypressWindow(); config: const { defineConfig } = require('cypress');
const synpressPlugins = require('@synthetixio/synpress/plugins');
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
specPattern: 'tests/e2e/specs',
supportFile: 'tests/support/index.js',
screenshotsFolder: 'tests/e2e/screenshots',
defaultCommandTimeout: 30000,
pageLoadTimeout: 30000,
requestTimeout: 30000,
chromeWebSecurity: true,
viewportWidth: 1366,
viewportHeight: 850,
video: false,
env: {
coverage: false,
},
retries: {
runMode: 0,
openMode: 0,
},
screenshotOnRunFailure: true,
setupNodeEvents(on, config) {
synpressPlugins(on, config);
return config
},
},
});
|
The workaround code doesn't work for me either |
@norswap I tried with the latest version of wagmi and it seems the issue is not there anymore. though I could not find any issues or PR in the wagmi mentioning this. I checked your repo and it seems the Also do you have a link to any PR or issue (in wagmi repo) that mentions this. Thanks |
@ayushrungta8 All that info (including link) is literally in my last message (here) The bug in wagmi only caused issues in my own repo and are seemingly unrelated to the playwright/synpress issue. Updating those probably fixed the issue (unless it was some other package, I linked the commit where I updated, so you can look yourself for what changed). |
I'm using the MetaMask test dApp and |
@spacesailor24 I believe your problem is not related to this issue. However, I've just released a fix for that bug under the |
Describe the bug
As it says in the title — in particular, playwright will timeout on
await metamask.confirmaTransaction()
even though the metamask transaction confirmation window is open & visible.The particular failing instance is here: https://github.com/norswap/0xFable/blob/master/packages/e2e/tests/specs/create.spec.ts#L84-L89
When running in headed mode, you can see the MetaMask confirmation window open but nothing happens.
Adding a
page.pause()
then resuming in the playwright console allows it to move past that, only to fail on a furtherconfirmTransaction
.To Reproduce
make dev
at top level (fourth subshell (circuits) may fail, doesn't matter)packages/e2e
and runmake chrome
orHEADLESS=false make chrome
page.pause()
in the code, so you might want to remove that to see the bugExpected behavior
metamask.confirmTransaction()
should work, as it did before.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: