How to record videos only for the failed test cases in CI pipeline using cypress, what configuration shall I make to achieve this? My cypress.json
looks like below:
{
"defaultCommandTimeout": 30000,
"pageLoadTimeout": 120000,
"requestTimeout": 30000,
"responseTimeout": 30000,
"execTimeout": 30000,
"taskTimeout": 30000,
"screenshotsFolder": "cypress/screenshots",
"trashAssetsBeforeRuns":true,
"testFiles": "**/*Smoke.spec.ts",
"video": false,
"videosFolder": "build/cypress/videos",
"viewportWidth": 1300,
"viewportHeight": 1000,
"animationDistanceThreshold": 50,
"reporter": "junit",
"reporterOptions": {
"mochaFile": "build/cypress/test-output-[hash].xml",
"toConsole": true,
"attachments": true
}
}
cypress run
. Screenshots on failure are not automatically taken duringcypress open
. - This is what their website says, so probably you are running withcypress open
, trycypress run
instead.