full-ram-6858
06/13/2022, 11:01 PMswift-angle-95455
06/14/2022, 1:20 AMpolite-diamond-19684
06/14/2022, 1:31 AMgray-kilobyte-89541
06/14/2022, 1:39 AMpolite-diamond-19684
06/14/2022, 1:40 AMgray-kilobyte-89541
06/14/2022, 2:43 AMthousands-school-59219
06/14/2022, 9:30 AMgentle-accountant-4760
06/14/2022, 9:54 AM./cypress/plugins/index.ts
instead it added empty rowable-family-92006
06/14/2022, 12:39 PMincalculable-artist-87185
06/14/2022, 1:17 PMastonishing-electrician-44897
06/15/2022, 8:39 AMexport default defineConfig({
e2e: {
env: {
FOO: 'BAR'
},
},
});
rough-magazine-51515
06/15/2022, 11:44 AMhallowed-mouse-50470
06/15/2022, 5:10 PMdamp-kilobyte-10207
06/15/2022, 6:28 PMripe-daybreak-97926
06/15/2022, 6:32 PMdamp-kilobyte-10207
06/15/2022, 6:34 PMchilly-noon-25793
06/15/2022, 7:03 PMrapid-yak-87393
06/15/2022, 7:13 PMrapid-yak-87393
06/15/2022, 7:14 PMchilly-noon-25793
06/15/2022, 7:32 PMrapid-yak-87393
06/15/2022, 8:26 PMchilly-noon-25793
06/15/2022, 8:31 PMchilly-noon-25793
06/15/2022, 8:34 PMlate-house-1562
06/15/2022, 8:42 PMsetupNodeEvents
creamy-noon-1182
06/16/2022, 7:38 AMworried-parrot-50579
06/16/2022, 8:23 AMadventurous-postman-3917
06/16/2022, 9:15 AMincalculable-artist-87185
06/16/2022, 3:06 PM"scripts": {
"cypress:opentst": "cypress open --env configFile=testEnvConfig",
"cypress:openacc": "cypress open --env configFile=accEnvConfig"
}
So now I have a Typescript file called 'testEnvConfig' like this (thanks for that 🙂 ):
export default defineConfig({
e2e: {
env: {
FOO: 'BAR'
},
},
});
Cypress picks up the env configuration if I put it in cypress.config.ts, but for some reason it does not pick it up from my 'testEnvConfig' file if I specify the fiel in the CLI.This used to work in Cypress 9 (when my config file was still json). So I am puzzled why it no longer picks it up now. Name of the file remains the same, it is just TS instead of JSON.nutritious-honey-65632
06/16/2022, 6:26 PMnpx cypress run --browser chrome --env fileConfig=stage
then inside cypress.config.js
inside e2e
object
setupNodeEvents(on, config) {
const file = config.env.fileConfig;
return getConfigurationByFile(file);
}
and function outside of the defineConfig
const fs = require('fs-extra');
const path = require('path');
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve('./cypress/', 'config', `${file}.json`)
return fs.readJson(pathToConfigFile);
}
my actual config file live in cypress/config/stage.json
late-house-1562
06/16/2022, 10:10 PM