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.envin the script cypress/plugins/index.js - Additional variables can be passed via
envobject in cypress.json - Extract any other variable from
process.envusingcypress/plugins/index.jscallback. - Uses dotenv package to read the
.envfile in the plugins file