Allow direct access to os level environment variable #22523
Labels
E2E
Issue related to end-to-end testing
topic: environment variables
type: enhancement
Requested enhancement of existing feature
What would you like?
I would like a way to directly look up os level environment variables without having to port them in one of the ways mentioned here https://docs.cypress.io/guides/guides/environment-variables#Setting
Why is this needed?
Currently, our team heavily relies on environment variables to figure out how the test script should behave. A few examples can be:
branch tag
,if print log
,if dry run
,if smoke test
,testing env
,test framework feature flag 1
,test framework feature flag 2
and etc. As you can see, some of them are not necessarily cypress testing specific so we have to universally store them as os level environment variables so it is accessible for the whole thing. Everytime we add or change something, we have to find thecypress run -env VARIABLE=${VARIABLE:-default},VARIABLE=${VARIABLE:-default},VARIABLE=${VARIABLE:-default},VARIABLE=${VARIABLE:-default}......
and update it. The line to execute cypress is getting harder and harder to read and maintain. It would be just easier to directly access os env vars in the test script.Other
Yes, we can absolutely work around it with example like https://stackoverflow.com/a/64773906, but it would be great to just have build in support for it
The text was updated successfully, but these errors were encountered: