Capturing videos with Poltergeist, PhantomJS and Capybara

Is it possible to capture video using PhantomJS in combination with Poltergeist, Capybara and Cucumber gems?

I used to use a headless hat that put the video in a specific folder in case of an unsuccessful scenario. If everything went well, the video was not saved.

Headless uses xvfb and ffmpeg. You can also use ffmpeg to provide the same functionality as here: https://github.com/leonid-shevtsov/headless/blob/master/lib/headless/video/video_recorder.rb

I basically need the same functionality, but I have no idea how to do this. Any advice is appreciated.

+4
source share
2 answers

This is a PhantomJS tutorial for recording videos: http://mindthecode.com/recording-a-website-with-phantomjs-and-ffmpeg

+3
source

You cannot record videos using PhantomJS, but I think you could hook something up to the screenshot at each step that Capybara takes (you will need to dig into the code to do this).

+1
source

Source: https://habr.com/ru/post/1484091/


All Articles