Skip to content

Commit 3a913a9

Browse files
Lucas Mendelowskiyyx990803
Lucas Mendelowski
authored andcommitted
docs(cypress): add env variables info (#1327)
1 parent 476e52e commit 3a913a9

File tree

1 file changed

+4
-0
lines changed
  • packages/@vue/cli-plugin-e2e-cypress

1 file changed

+4
-0
lines changed

packages/@vue/cli-plugin-e2e-cypress/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Cypress offers a rich interactive interface for running E2E tests, but currently
3131

3232
We've pre-configured Cypress to place most of the e2e testing related files under `<projectRoot>/tests/e2e`. You can also check out [how to configure Cypress via `cypress.json`](https://docs.cypress.io/guides/references/configuration.html#Options).
3333

34+
## Environment Variables
35+
36+
Cypress doesn't load .env files for your test files the same way as `vue-cli` does for your [application code](https://github.com/vuejs/vue-cli/blob/dev/docs/env.md#using-env-variables-in-client-side-code). Cypress supports a few ways to [define env variables](https://docs.cypress.io/guides/guides/environment-variables.html#) but the easiest one is to use .json files (either `cypress.json` or `cypress.env.json`) to define environment variables. Keep in mind those variables are accessible via `Cypress.env` function instead of regular `process.env` object.
37+
3438
## Installing in an Already Created Project
3539

3640
``` sh

0 commit comments

Comments
 (0)