Multiple config files in Cypress 10? #22517
-
I currently run my e2e tests on multiple environments. To achieve this I have created a config file for each environment and pass the configFile value in the CLI. When upgrading I realized Cypress 10.0.0 does not support multiple config files. Is there away to achieve this in the latest version of Cypress? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Why it is not supported? It is supported! have you tried? |
Beta Was this translation helpful? Give feedback.
-
hello! 👋 have you tried |
Beta Was this translation helpful? Give feedback.
-
This does work in version 10 and you can extend from the default config: I put a mobile config file under Then reference it in File
|
Beta Was this translation helpful? Give feedback.
-
Simpler way to do this:
`const { defineConfig } = require("cypress") module.exports = defineConfig({ |
Beta Was this translation helpful? Give feedback.
-
You might want to check Gleb's blog post about this issue - https://glebbahmutov.com/blog/load-cypress-env-settings/ |
Beta Was this translation helpful? Give feedback.
This does work in version 10 and you can extend from the default config:
I put a mobile config file under
cypress/configs/cypress.mobile.config.ts
Then reference it in
package.json
scripts:"cy:open:mobile": "cypress open --e2e --browser chrome --config-file cypress/configs/cypress.mobile.config.ts",
File
cypress.mobile.config.ts
contents: