Dev.json config file has been ignored in 10.9.0 version #24310
Unanswered
milica7
asked this question in
Questions and Help
Replies: 1 comment
-
With Cypress v10, you are no longer able to load json files to your configuration. Basically, you have two options:
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) {
// see if we passed --env version=dev
if (config.env.version = 'dev') {
// if we did, use dev.json file an put its content into env object, so we can access it via Cypress.env() function
config.env = require('./dev.json')
}
}
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
we are having issues with multiple config files, we followed the instructions from https://docs.cypress.io/api/plugins/configuration-api#Switch-between-multiple-configuration-files, but when we run tests with something like this _cypress run --env configFile=dev, the config from the main file is loaded (cypress.config.js) and we can't see any error before that, so seems like the dev.json is not loaded at all.
Beta Was this translation helpful? Give feedback.
All reactions