You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# these variables will be read automatically
# CYPRESS_ part will be removed
# access them with Cypress.env("ping"), Cypress.env("HOST")
CYPRESS_ping=123
CYPRESS_HOST=laura.dev.local
cypress_api_server=http://localhost:8888/api/v1/
It suggests that variables will be read and they do appear as test asserts pass.
But it is passing due to the command-line argument, not the .env file.
dotenv correctly includes the content of the .env into the process.env object, however, while cypress does have CYPRESS_ variables submitted in the command line, it seems that the addition of the dotenv comes too late and Cypress already passed over environment variables.
If that is the case then that comment and sample variables should be deleted as they are misleading.
In the current version of the cypress-example-recipes/examples/server-communication__env-variables/.env , in the comment
It suggests that variables will be read and they do appear as test asserts pass.
But it is passing due to the command-line argument, not the
.env
file.dotenv
correctly includes the content of the.env
into theprocess.env
object, however, while cypress does haveCYPRESS_
variables submitted in the command line, it seems that the addition of thedotenv
comes too late and Cypress already passed over environment variables.If that is the case then that comment and sample variables should be deleted as they are misleading.
Tested with: Cypress 11.1, macOS 11.13.6, node 16.15.1
The text was updated successfully, but these errors were encountered: