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: 2 comments 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.
-
|
I had to set the path correctly in The playwright and synpress commands seemingly run the config file first. I thought I was to load the env in the wallet setup file, but that file gets transpiled to js and called from |
Beta Was this translation helpful? Give feedback.
@syedyousafraza
cypress.envis 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 runLets say that you have
npm run testwhich runssynpress run. Then you can also runENV_VAR=VALUE npm run test.dotenv(checkpreloadsection):https://www.npmjs.com/package/dotenv
Create new
.envfile with variables and then runsynpress runadditionally requiring your.envfile.export ENV_VAR=VALUEbefore running tests... and many more different ways. You can also r…