Capture video with Poltergeist, PhantomJS and Capy

2019-06-22 09:49发布

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

I have used the Headless gem previously, which put a video in a specific folder in case a scenario failed. If all went well, no video was stored.

Headless uses Xvfb and ffmpeg. Can ffmpeg also be used to provide the same functionality as shown 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 go about it. Any advice is highly appreciated.

2条回答
smile是对你的礼貌
2楼-- · 2019-06-22 10:21
迷人小祖宗
3楼-- · 2019-06-22 10:36

You can't capture video with PhantomJS, but I guess you could hook something up to take a screenshot on each step that Capybara takes (you'd need to dig into the code to do that though).

查看更多
登录 后发表回答