microsoft / microsoft/playwright
[Feature]: Automatically stop the screencast video recording and save the video file when the page is closed.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 96.3k
- Forks
- 6.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 180
Description
🚀 Feature Request
Suppose recording is started using page.screencast.start({path: videoPath}). If the page closes before page.screencast.stop() is called to stop the recording, I would like the recording to stop automatically and the video file to be saved.
Example
await page.screencast.start({path: 'video.webm'});
await page.getByRole('button', {name: 'close window'}).click(); // close window
// video.webm file is automatically saved
Motivation
To control the recording area, I want to start recording using screencast.start() rather than the newContext() options.
However, this requires calling screencast.stop() before the page closes.
This makes it impossible to record a video showing "the window closing when a button is pressed."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the page.screencast.start({path: videoPath}) and page.screencast.stop() entry points, then trace what happens when the page closes. Add coverage for the shown close-window flow and verify that video.webm is saved without an explicit stop call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100