adorable-smartphone-87280
05/09/2022, 6:04 PMbaseUrl
? The docs at https://docs.cypress.io/api/plugins/configuration-api#Switch-between-multiple-configuration-files indicate that this value can be set in cypress/config/env.json
but it fails when I do that. I have to have it set in cypress.json
or pass it in at runtime via my run scripts. I am thinking about using /plugins/index.js
to set my baseUrl
, but it would really be nice to just set it in my environmental config files. Anyone else been down this path before and know what I'm missing?adorable-smartphone-87280
05/09/2022, 6:06 PM--config baseUrl=https://env.domain.com"
gray-kilobyte-89541
05/09/2022, 6:16 PMfunction getConfigurationByFile(file) {
const pathToConfigFile = path.resolve('..', 'config', `${file}.json`)
return fs.readJson(pathToConfigFile)
}
// plugins file
module.exports = (on, config) => {
// accept a configFile value or use development by default
const file = config.env.configFile || 'development'
return getConfigurationByFile(file)
}
adorable-smartphone-87280
05/09/2022, 6:18 PM/config/env.json
files in tests.adorable-smartphone-87280
05/09/2022, 6:30 PM/config/env.json
in the directory one up from the package I have cypress
installed in.adorable-smartphone-87280
05/09/2022, 6:33 PMError: ENOENT: no such file or directory, open '/Users/user/Documents/src/project/parentFolder/config/env.json'
adorable-smartphone-87280
05/09/2022, 6:33 PM".."
from the path.resolve()
step.