-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Platform specific environment variables #5036
Comments
There is also https://docs.cypress.io/api/cypress-api/platform.html#Syntax along with https://docs.cypress.io/api/plugins/configuration-api.html#Usage can possibly do what you need |
Thanks. I tried if (Cypress.platform === 'win32') {
config.env.INSTALL_BINARY =
'https://npm.asdasd.se/win32-64/cypress.zip';
} else {
config.env.INSTALL_BINARY =
'https://npm.asdasd.se/linux/cypress.zip';
} But it did not take. Still it downloads from default location, not the ones specified above. |
should it be |
I tried both. |
actually by the time plugins file is read, cypress has already been installed so yeah this will not work. Sorry i misunderstood what you were trying to do here. |
You have to set the environment variables before starting Cypress, which you can do with a small script. See #5037 (comment) too. |
We want to allow different versions of Cypress with different projects, npm packages in Git repositories.
Current behavior:
If we add this in our
.npmrc
We will have something that will download the wrong binary when developers use Windows.
Desired behavior:
Allow platform specific environment variables, and fall back on current behavior if no specific variables are set.
The
.npmrc
can have:Where the suffix is taken from platform names in Nodejs.
So that on Windows the effective value of
CYPRESS_INSTALL_BINARY
would behttps://this.is/the/win32/binary.zip
.These environment variables could then be put in the
.npmrc
in the repository of each application.Steps to reproduce: (app code and test code)
#5037
Versions
All of them.
The text was updated successfully, but these errors were encountered: