xk6-browser icon indicating copy to clipboard operation
xk6-browser copied to clipboard

WiP: Video capture

Open pablochacin opened this issue 11 months ago • 0 comments

What?

Implements a video recording API for the browser using the screencast API to capture screens and ffmpeg for converting them into a video (similar approach used by puppeteer's screen recorder)

The functionality to start recording a video is added to the page interface. As it is not possible to have more than one active recording at a time, it was decided not to return a screenrecorder object as in the puppeter's API , but leave the functionality to control the active recording (basically, stop the recording) in the page object itself. Addopting pupperter's model would be relatively simple.

Why?

  • [ ] Capture what the end-user experience is like
  • [ ] Help debug flaky tests that fail due to unforeseen changes in the page under test

Todo

  • [ ] Fix: output directed from ffmpef to the file persister is truncated
  • [ ] Ensure video is recorded if the page is closed
  • [ ] Review API (method names, etc)
  • [ ] Add tests
  • [ ] [ ] Review style
  • [ ] Document
  • [ ] Add Examples

Checklist

  • [ ] I have performed a self-review of my code
  • [ ] I have added tests for my changes
  • [ ] I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Closes #103

pablochacin avatar Mar 05 '24 12:03 pablochacin