Last update 2/20/2018
Provide an ability to create a video of a test run (in Chrome and Firefox (included headless) at start ).
Make it easier to identify why your test is failed. Especially it's actual for CI.
I guess the best way is make screenshots by using browser's api and make a video from them by using a tool like ffmpeg.
ffmpeg or find other way;If anyone have some thoughts here feel free to comment
We just started to test out something similar for grabbing screen videos of tests by launching a child_process.spawn of ffmpeg (and closing it) in Before() / After() hooks, naming it based on the SUT/scenario. Unfortunately, it relies on being able to record the active x11 screen session (ie, won't work in headless mode).
Maybe it would work in headless if something like xvfb was used to simulate an x11 display?
Our setup is currently testcafe+cucumberjs, so we're relying on the cucumber Before/After hooks and just using testcafe as a driver+assertion framework.
The we're using to generate the mkv is:
child_process.spawn(
'/usr/bin/ffmpeg',
`-f x11grab -s 1024x700 -i :0.0+0,40 -c:v libx264 -preset ultrafast -crf 0 /tmp/${name}.mkv`.split(' ')
)
Another thought - for C.I. you could run the setup in non-headless within a docker container (therefore, no reliance on xvfb or headless mode), we did something similar with selenium docker images (just watch when needed by hooking to a vnc server the container was running).
Implementation of the feature is delayed due to unclear consequences of adding LGPL licensed FFMPEG to TestCafe dependencies. I'm in process in process of clarifying legal considerations with our lawyer.
For anyone who is desperate to record video from Chrome (e.g. to troubleshoot headless CI) I've made this reporter https://www.npmjs.com/package/testcafe-reporter-chrome-recorder
I wouldn't recommend to use it if there's an alternative but worked for me.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.
Most helpful comment
For anyone who is desperate to record video from Chrome (e.g. to troubleshoot headless CI) I've made this reporter https://www.npmjs.com/package/testcafe-reporter-chrome-recorder
I wouldn't recommend to use it if there's an alternative but worked for me.