chore: update video api and implementation#39054
Conversation
- Path is available once video file is created. - No `path` option when stopping, use `saveAs()` instead. - More tests around edge cases.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e952824 to
ddf0ad2
Compare
Test results for "tests 1"4 failed 5 flaky34256 passed, 662 skipped Merge workflow run. |
Test results for "MCP"7 failed 1 flaky3607 passed, 129 skipped Merge workflow run. |
| // ... perform actions ... | ||
| await page.video().stop({ path: 'video.webm' }); | ||
| await page.video().stop(); | ||
| await page.video().saveAs('video.webm'); |
There was a problem hiding this comment.
This is a really unusual API for us, we recommend to always write 2 lines instead of passing path into one. screenshot({ path }), pdf({ path }), etc.
page.video()is always available.video.path()is available right away upon recording, and throws when no video is being recorded.pathoption when stopping, usesaveAs()instead.page did not produce any video frameserror anymore - add a single white frame instead.