feat(plugins): add screencast plugin (replaces subtitles)#5543
Merged
feat(plugins): add screencast plugin (replaces subtitles)#5543
Conversation
New `screencast` plugin built on Playwright 1.59's page.screencast API. Records WebM video with optional burn-in action captions (showActions) and optional standalone .srt subtitles. Wires into the unified `on=` parameter introduced in #5542 with two valid modes: `on=fail` (default; deletes the recording on pass) and `on=test` (always keeps). - Replaces and removes the legacy `subtitles` plugin and its test - Bumps `playwright` devDependency to 1.59.0 (required for page.screencast) - Adds 8 unit tests covering modes, captions, subtitles, video=false fallback, missing-API guard, invalid-mode rejection - Updates examples/codecept.config.js to swap subtitles for screencast - Documents the plugin in docs/plugins.md and docs/playwright.md, including the empirically-verified "two videos" note when helper video:true and the plugin are enabled together Verified against a real Playwright 1.59 run: produces output/screencast/*.webm plus *.srt; coexists with helper recordVideo without conflict.
DavertMik
commented
Apr 29, 2026
Playwright 1.59 removed the experimental `_react=` and `_vue=` selector
engines, which broke `{ react: ... }` and `{ vue: ... }` locators with:
locator.all: TypeError: Cannot read properties of undefined
(reading 'queryAll')
at InjectedScript._queryEngineAll
Reimplemented React locators on top of the `resq` library + `page.evaluateHandle`
(the same approach the Puppeteer helper already uses). Dropped Vue locator
support entirely — there is no in-deps equivalent to resq for Vue, and the
public surface was minimal.
- lib/helper/extras/PlaywrightReactVueLocator.js: rewrite findReact via resq;
remove findVue
- lib/helper/Playwright.js: remove findVue import and Vue branches in
findElements / findElement
- test/acceptance/react_test.js: remove the third scenario that used the
raw `{ pw: '_react=...' }` form (no longer valid syntax)
- test/unit/locator_test.js: drop `pw: '_react=button'` and
`pw: '_vue=button'` cases
- typings/index.d.ts: drop `{ vue: string }` from ILocator
- docs/locators.md: update note to remove `_react`/`_vue` mentions
Verified end-to-end against Playwright 1.59:
React Selectors
✔ props @puppeteer @playwright (3.7s)
✔ component name @puppeteer @playwright (3.4s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
screencastplugin built on Playwright 1.59'spage.screencastAPI. Records WebM video, optionally burns in action captions (showActions), and optionally writes a standalone.srt.on=parameter from feat(plugins): unify screenshot/pause/aiTrace/heal under shared on= parameter #5542 with two modes:on=fail(default — deletes the recording on pass) andon=test(always keeps).subtitlesplugin entirely (and its unit test) — replaced byscreencast({ subtitles: true }).playwrightdevDependency to^1.59.0(required forpage.screencast).examples/codecept.config.jsto demonstrate the new plugin in place of the removedsubtitles.Configuration
CLI:
Verification
video=falsefallback, missing-API guard, invalid-mode rejection. Full plugin unit suite: 60/60 passing, lint clean.examples/project: producedoutput/screencast/*.webm(52KB) and*.srt. Confirmed empirically that helper-levelvideo: trueand the plugin coexist without conflict — they write to separate directories (warning is documented).Test plan
npm run lintnpx mocha 'test/unit/plugin/**/*_test.js'examples/withscreencast: { enabled: true, on: 'test', subtitles: true }against a real test; verifyoutput/screencast/*.webmand matching.srtappear.-p screencast:on=faildeletes the .webm for a passing test.Notes
lib/plugin/subtitles.jstest/unit/plugin/subtitles_test.jsevent.step.started(rather thanevent.test.before) becausehelper.pageis created lazily during the first step.🤖 Generated with Claude Code