This recipe shows how to pass environment variables to your tests
- See package.json file which runs Cypress with environment variables set. The variables that start with
CYPRESS_
are extracted automatically. Other variables are copied fromprocess.env
in the script cypress/plugins/index.js - Additional variables can be passed via
env
object in cypress.json - Extract any other variable from
process.env
usingcypress/plugins/index.js
callback.
Note: for testing scripts, the same environment variables set in package.json
are also set in .env file