Record is not reading env variable set in cypress.json or cypress.env.json
See original GitHub issueCurrent behavior:
Not able to run the cypress run --record
command without a flag, when storing the key
as an ENV variable
It works exporting the variable first and then run the cypress run --record
Desired behavior:
Being able to store env variable
How to reproduce:
- Set env as following in: cypress.json
{ "projectId": "1280ayu", "env": { "cypress_record_key": "88897382" } }
CYPRESS_RECORD_KEY or RECORD_KEY or record_key
2. run: cypress run --record
3. Issue occurs: User gets error:
You can pass us your Record Key like this:
cypress run --record --key <record_key>
You can also set the key as an environment variable with the name CYPRESS_RECORD_KEY.
https://on.cypress.io/how-do-i-record-runs
Same thing happens if user tries to store it in: cypress.env.json
Test code:
Additional Info (images, stack traces, etc)
- Operating System: Ubuntu
- Cypress Version: 1.0.3
- Browser Version: Chrome 61
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Environment Variables | Cypress Documentation
Values in here will overwrite conflicting environment variables in your Cypress configuration. This strategy is useful because if you add cypress.
Read more >Environment Variables in Cypress - Tools QA
This article covers - What are environment variables in Cypress? How to access them in Cypress?How to set Environment variables in Cypress?
Read more >Specify environment variables for Cypress tests - BrowserStack
Learn how to specify environment variables for your Cypress tests while running them on BrowserStack.
Read more >Define variables in cypress.env.json - Stack Overflow
I moved cypress. env. json into another folder, as I checked in settings - Cypress found correctly variables from cypress. json, but the...
Read more >Specify Environment Variables with Cypress Testing
Cypress Test Environment Variables · Using the env option key in your Cypress configuration file · Create a cypress.env.json file and specify your...
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 Free
Top 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
https://docs.cypress.io/guides/guides/environment-variables.html#Option-2-cypress-env-json
I would like to manage record key in
cypress.env.json
and gitignore the file, rather than export it in local bash_profile, as this doc suggests.@donaldshen @kfriars Please open a new issue detailing exactly what and why you want this feature request. 2+ yr old issues are not the place to ask for feature requests.