In my Cypress framework, I have the following config files at the root level of my project.
cypress.json(Contains configs for mochawesome report tool)qa.json(Points at my QA environment).staging.json(Points at my Staging environment).
Here is what my staging.json file looks like:
{
"extends": "./cypress.json",
"baseUrl": myStagingUrl,
}
As you can see I am trying to extend cypress.json so that I don't have to duplicate the mochawesome configuration.
Here is what my cypress.json file looks like:
{
"reporter": "cypress-mochawesome-reporter",
"reporterOptions": {
"reportDir": "cypress/reports",
"charts": true,
"reportPageTitle": "My Test Suite",
"embeddedScreenshots": true,
"inlineAssets": true
},
"video": false
}
When I run npx cypress run --config-file staging.json, the tests run but the HTML test report isn't generated.
If I copy & paste the values from cypress.json into staging.json, the HTML report is generated.
So the cypress.json isn't being picked up by the tests at all.
Can someone please tell me how I can extend the cypress.json so its' values are picked up even when I use other config files?