I'm new to cypress and have created my first project with a cypress.json file in the root directory.
The contents of this file are as follows:
{
projectId: bdld4
env:{
host: http://localhost:8000,
email: [email protected],
password: obviouslyNotaRealPassword
}
}
Within the integration folder I have a test case which is attempting to access those environment variables:
Cypress.env('host')
This returns undefined. I have also tried this in cypress.env.json and have also tried placing the cypress.json file one level above the Cypress folder.
To run the tests, i'm using npx cypress open
and selecting the test from the gui. Am I running the tests incorrectly or should the file be placed elsewhere? Any ideas?