This seems like an obvious request, but I wasn't able to find it from searching, please delete if it's a duplicate.
When video recording is on, all recorded videos are processed/compressed and saved. This works fine, but as our test suite starts to grow our CI job is spending a lot of time on processing/compressing videos. Having the video is great for debugging a failure in CI, but we don't care about the videos for passing tests.
Have an option besides true/false for the video
setting in cypress.json
, maybe something like onlyOnFail
. https://docs.cypress.io/guides/references/configuration.html#Videos
This setting would make the cypress runner throw the video away as soon as a spec passes and save us the time of compressing and the storage space of storing the video.
Cypress 3.0.2
Jenkins 1.642.4
Electron 59
Could I give this a try as a first contribution ?
Hey, this is already a feature, but probably not as clear as it should be.
You can set videoUploadOnPasses
to false
, which would only process, compress, and upload videos when recording if there are failures within the spec.
Line of code I tracked this down to: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/modes/run.coffee#L497
I can see how the docs are not clear that this configuration correlates to the video processing and compression though, so I created a new issue in our docs to document this here: https://github.com/cypress-io/cypress-documentation/issues/815. Our documentation is open source and contributions are welcome. 馃槃
Still not mentioned in the description of the Videos functionality:
https://docs.cypress.io/guides/core-concepts/screenshots-and-videos.html#Videos
Hello. I really like Cypress so far!
I was wondering if there is a way to only capture video recording segment of the failing test. So for example if I had 5 tests and tests 2 and 3 failed. Then like we have a screenshot image per failing test we could have a video recording per failing test. I can only see that we record the video of the entire suite run (which includes passing and failing tests).
Any help appreciated.
Thanks
:)
@jennifer-shehane please read above. Thanks :)
@rahi-panaseer This is not currently configurable from Cypress.
You can get a lot of data on the test run results from the Module API, I think this may potentially have data including in the failedTests
, with a videoTimestamp
and a duration that is used to jump to the correct place of the video in the Dashboard. You could potentially use this to cut out the video in post processing, but the entire video would still be recorded.
I'd open a new issue if you want an option for Cypress to do this automatically. It's theoretically possible for Cypress to do this - although it would still require the entire video be recorded. We don't know what will fail ahead of time.
Is there a way to save videos only for failing tests, if the dashboard service is not used? If I understand the docs correctly, the videoUploadOnPasses can only be used with the dashboard service.
@pascalbe-dev See this issue https://github.com/cypress-io/cypress/issues/2522
Most helpful comment
Hey, this is already a feature, but probably not as clear as it should be.
You can set
videoUploadOnPasses
tofalse
, which would only process, compress, and upload videos when recording if there are failures within the spec.Line of code I tracked this down to: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/modes/run.coffee#L497
I can see how the docs are not clear that this configuration correlates to the video processing and compression though, so I created a new issue in our docs to document this here: https://github.com/cypress-io/cypress-documentation/issues/815. Our documentation is open source and contributions are welcome. 馃槃