Skip to content

Files

Latest commit

cc13866 · Jun 6, 2022

History

History

server-communication__env-variables

Server communication: passing environment variables

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 from process.env in the setupNodeEvents function
  • Additional variables can be passed via env object in cypress.config.js
  • Extract any other variable from process.env using the setupNodeEvents function.
  • Uses dotenv package to read the .env file in the Cypress configuraton