environment variable not working #272
-
can you please tell me where I should add the environment variables (directory?) like PRIVATE_KEY, SECRET_WORDS etc for metamask wallet? right now it's not recognizing the one I added in my cypress.json file. I also tried without env variable using ; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@syedyousafraza It's explained in the README: You have many different options:
.. and many more different ways. You can also refer to synpress usage examples which are also mentioned in README: Cheers, |
Beta Was this translation helpful? Give feedback.
@syedyousafraza
cypress.env
is notprocess.env
, so it's not working.It's explained in the README:
https://github.com/Synthetixio/synpress#-important
You have many different options:
ENV_VAR=VALUE synpress run
Lets say that you have
npm run test
which runssynpress run
. Then you can also runENV_VAR=VALUE npm run test
.dotenv
(checkpreload
section):https://www.npmjs.com/package/dotenv
Create new
.env
file with variables and then runsynpress run
additionally requiring your.env
file.export ENV_VAR=VALUE
before running tests... and many more different ways. You can also r…