baseUrl not used in cypress.env.json
See original GitHub issueCurrent behavior
If you have a baseUrl in the cypress.env.json it’s not beeing used.
Desired behavior
just like the previous version I would like to have a local file cypress.env.json where the baseUrl is beeing read and used in my test.
Test code to reproduce
// Tried both ways and did not work
{
"e2e": {
"baseUrl": "https://google.com/"
},
"baseUrl": "https://google.com/"
}
Cypress Version
10.0.3
Other
It should work according the documentation: https://docs.cypress.io/guides/guides/environment-variables#Option-2-cypress-env-json
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Environment Variables | Cypress Documentation
However, you do not need to use environment variables to point to the origin and domain under test. Use baseUrl instead of environment...
Read more >Switch between environments in Cypress - Filip Hric
The easiest way to switch environments is to simply rewrite your cypress.json file and set baseUrl to a different value each time you...
Read more >Override Cypress.config().baseUrl with environment variable ...
env file. I can't set it directly in the cypress.json file. And when I try to use cy.visit(process.
Read more >cypress-io/cypress - Gitter
baseUrl = config.env. ... I saw that fixtures don't have to be .json but I have not found an example of how ......
Read more >Cypress v10 Environment Variables - Gleb Bahmutov
Cypress v10 has merged the plugins file with the cypress.json file into a single ... our project does not use fixture files
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe I have a workaround for you guys @gagneet @bvanderneut , inside the
setupNodeEvents
I have this codeand with this
getConfigByFile
function below I’m able to dynamically change thebaseUrl
or any config or env variable by choosing which config file to pass such asnpx cypress open --env envKey=dev
I place this function anywhere outside of
module.exports
but still within thecypress.config.js
repo for reference:
@bvanderneut Thank you for the repro and apologies for my earlier response where I looked into
cypress.config.js
instead 😅 . I can confirm, you’ve found a buggo! 🐛 I’ll be passing this along to the team.Repo with reproducible example Steps to test:
yarn && npx cypress open
-> e2e testing -> selectbaseUrl.cy.js