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

acceptMetamaskAccess() failing with cy.task() error #800

Open
mflorlorenzo opened this issue Jul 5, 2023 · 3 comments
Open

acceptMetamaskAccess() failing with cy.task() error #800

mflorlorenzo opened this issue Jul 5, 2023 · 3 comments
Labels
bug 🐛 Something isn't working

Comments

@mflorlorenzo
Copy link

mflorlorenzo commented Jul 5, 2023

Describe the bug
acceptMetamaskAccess() is failing.

CypressError: cy.task() must only be invoked from the spec file or support file.

From Your Spec Code: at Context.eval (webpack:///./node_modules/@synthetixio/synpress/support/commands.js:184:0)

Line 184:
return cy.task('acceptMetamaskAccess', options);

To Reproduce
Steps to reproduce the behavior:

  1. Run the project
  2. Wait until framework has to accept the metamask login access
  3. See error

Expected behavior
Login successfully. acceptMetamaskAccess() should works as it did before.

Desktop (please complete the following information):

  • OS: macOS 12.6.5
  • Synpress version: 3.7.1
  • running locally

Additional context
There was an issue on cypress related to this on a new version (12.15.0), but I'm using an old one (12.11.0), so should works.
cypress-io/code-coverage#667

@mflorlorenzo mflorlorenzo added the bug 🐛 Something isn't working label Jul 5, 2023
@ayushrungta8
Copy link

@mflorlorenzo I also faced the same issue a few days ago. For me the thing was even though I had gone back to an older version the test run was still using the latest version. You can try by checking the starting of the test where it shows all the spec files and other info

@mflorlorenzo
Copy link
Author

Well, I found the issue.
I changed the cypress version from 12.16.0 to 12.14.0 on @synthetixio/synpress/node_modules/cypress/package.json and works !
@synthetixio-team is there a chance to take a look on it please? From Cypress say version 12.16.0 has the fix for this error, but it's not working here. Thanks

@aziolek
Copy link

aziolek commented Jul 7, 2023

@mflorlorenzo: it's not Synpress's fault. As the Cypress team expressed here they know about some edge cases that still exist in 12.16.0. I do confirm that pinning Cypress version to 12.14.0 solves the problem for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants