I've read Environment Variables in Cypress and other articles regarding passing environment variables in Cypress runs. However how can I refer to the environment variables in my JSON config files?
For example, I do
$ npm run cy:open -- --config-file config/mytests.json --env db.user=db_user,db.password=pw1234abcd
because I want to avoid hard-coding the DB creds in my config file, like this
{
...
"env" : {
"db" : {
"user" : "db_user",
"password" : "pw1234abcd"
}
}
}
But what's the syntax in the JSON file to use the passed-in values? What should this look like?
{
...
"env" : {
"db" : {
"user" : "???syntax???",
"password" : "???syntax???"
}
}
}