GithubHelp home page GithubHelp logo

Comments (5)

cinjon avatar cinjon commented on July 27, 2024

This is true even if I just copy-paste in https://github.com/Synthetixio/synpress/blob/master/tests/e2e/specs/metamask-spec.js and run it. It always fails to complete the cy.task('setupMetamask') function.

from synpress.

raparri01 avatar raparri01 commented on July 27, 2024

I had a similar issue and it took a few rounds of debugging to get this base test case passing. Here's what I noticed / changed:

  1. The tsconfig.js in my /tests/e2e was not being picked up by the typescript compiler so I had to make debugging changes to the tsconfig in my project root
  2. The application running at localhost didn't accept connections to rpc's with chainId: 42 (kovan) so I made sure it was supported by my rpc connector
  3. I was not targeting the right ecmascript target. Changing the target from es5 to esnext got the tests working
  4. Needed to set importHelpers in my compilerOptions to true
  5. Needed to install tslib and set it's path in the paths object of tsconfig

Hope these help you!

from synpress.

cinjon avatar cinjon commented on July 27, 2024

Thanks for helping @raparri01 . I switched to using dappeteer (with puppet) and it worked more smoothly.

from synpress.

drptbl avatar drptbl commented on July 27, 2024

@cinjon @raparri01 sorry for late response.

You are missing SKIP_METAMASK_SETUP=true if you want to use your custom setupMetamask() function in tests. In general, you shouldn't be really using it this way if not required.

I recommend sticking with default method which requires you to set environmental variables mentioned in the readme to make it work (like SECRET_WORDS='test test' or PRIVATE_KEY=test). Then everything is handled automatically for you every test and you don't have to repeat it yourself in your tests.

from synpress.

4ortytwo avatar 4ortytwo commented on July 27, 2024

@drptbl where do you have to set these environment variables?

edit:

Nevermind! Had to set those before I ran the command:

PRIVATE_KEY="" NETWORK_NAME=rinkeby yarn synpress run

Got confused because in the readme, I saw -e and thought I have to pass the envs after the command itself, and it wasn't working for me

from synpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.