Document that Cypress.env() parses booleans
See original GitHub issueGiven CYPRESS_IS_TRAVIS=true cypress open
, when I run Cypress.env()
in the developer tools it returns:
{
IS_TRAVIS: true
}
I would expect it to instead return this based on the docs:
{
IS_TRAVIS: 'true'
}
Because the documentation does not mention that string values like “true” are parsed into boolean values.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Environment Variables | Cypress Documentation
Difference between OS-level and Cypress environment variables In Cypress, "environment variables" are variables that are accessible via Cypress.env.
Read more >How To Inject Environment Variables Into Cypress Tests
Cypress automatically reads all environment variables that start with CYPRESS_ prefix and makes them available in Cypress.env() object.
Read more >TypeScript All the Things in Your Cypress Tests #frontend ...
Learn how we use TypeScript in our Cypress tests at Twilio SendGrid and the tips and tricks we've learned along the way.
Read more >Evaluate boolean environment variable in Python
Option 1. I think this works well: my_env = os.getenv("ENV_VAR", 'False').lower() in ('true', '1', 't').
Read more >Cypress-tags - npm.io
Select tests by passing a boolean expression of tags using AND and OR to the Cypress environment variable CYPRESS_INCLUDE_EXPRESSION .
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
Hey @darellkoh, sounds great!
I would likely put this in the Examples section showing an example of the usage above and saying something like: