Reputation: 550
I have a 5 .js file under the integration folder and want to run single .js file in cypress. but error thrown like:
The following validation error was thrown by your plugins file (
C:\Users\admin\LegrandRX\cypress\plugins\index.js
). Error: Thebefore:run
event requires the experimentalRunEvents flag to be enabled. To enable it, set"experimentalRunEvents": true
in your cypress.json
I have set script: { "cy:run": "cypress run"}
and I have also tried "experimentalRunEvents": true
in cypress.json according to error but nothing to successed
Cypress.json file added from comment:
{
"reporter": "cypress-mochawesome-reporter",
"reporterOptions": {
"reportDir": "cypress/reports",
"charts": true,
"overwrite": false,
"html": false,
"json": true,
"reportPageTitle": "My Test Suite",
"embeddedScreenshots": true,
"inlineAssets": true,
"experimentalRunEvents": true
},
"video": false
}
Upvotes: 0
Views: 407
Reputation: 18634
Please add "experimentalRunEvents":true
outside the reporterOptions
{
"reporter": "cypress-mochawesome-reporter",
"reporterOptions": {
"reportDir": "cypress/reports",
"charts": true,
"overwrite": false,
"html": false,
"json": true,
"reportPageTitle": "My Test Suite",
"embeddedScreenshots": true,
"inlineAssets": true
},
"experimentalRunEvents": true,
"video": false
}
To run a single spec file you can use the command:
cypress run --spec "cypress/integration/examples/actions.spec.js"
Upvotes: 1