Skip to content

feat(plugins): add screencast plugin (replaces subtitles)#5543

Merged
DavertMik merged 4 commits into4.xfrom
feat/screencast-plugin
Apr 29, 2026
Merged

feat(plugins): add screencast plugin (replaces subtitles)#5543
DavertMik merged 4 commits into4.xfrom
feat/screencast-plugin

Conversation

@DavertMik
Copy link
Copy Markdown
Contributor

Summary

  • Adds a new screencast plugin built on Playwright 1.59's page.screencast API. Records WebM video, optionally burns in action captions (showActions), and optionally writes a standalone .srt.
  • Wires into the unified 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) and on=test (always keeps).
  • Removes the legacy subtitles plugin entirely (and its unit test) — replaced by screencast({ subtitles: true }).
  • Bumps playwright devDependency to ^1.59.0 (required for page.screencast).
  • Updates examples/codecept.config.js to demonstrate the new plugin in place of the removed subtitles.

Configuration

plugins: {
  screencast: {
    enabled: true,
    on: 'fail',          // 'fail' (default) | 'test'
    captions: true,      // burn-in action overlays via showActions()
    subtitles: false,    // also write a standalone .srt
    video: true,         // false + subtitles:true = SRT-only
  }
}

CLI:

npx codeceptjs run -p screencast
npx codeceptjs run -p screencast:on=test
npx codeceptjs run -p screencast:on=test;captions=false;subtitles=true

Verification

  • 8 new unit tests covering all modes, captions toggle, subtitles, video=false fallback, missing-API guard, invalid-mode rejection. Full plugin unit suite: 60/60 passing, lint clean.
  • Real Playwright 1.59 smoke run against the examples/ project: produced output/screencast/*.webm (52KB) and *.srt. Confirmed empirically that helper-level video: true and the plugin coexist without conflict — they write to separate directories (warning is documented).

Test plan

  • npm run lint
  • npx mocha 'test/unit/plugin/**/*_test.js'
  • Run examples/ with screencast: { enabled: true, on: 'test', subtitles: true } against a real test; verify output/screencast/*.webm and matching .srt appear.
  • Verify -p screencast:on=fail deletes the .webm for a passing test.

Notes

  • Removed plugin (clean break, not a deprecation alias):
    • lib/plugin/subtitles.js
    • test/unit/plugin/subtitles_test.js
  • The plugin starts the screencast on the first event.step.started (rather than event.test.before) because helper.page is created lazily during the first step.

🤖 Generated with Claude Code

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.
Comment thread docs/playwright.md Outdated
Comment thread docs/playwright.md Outdated
DavertMik and others added 3 commits April 29, 2026 22:18
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)
@DavertMik DavertMik merged commit 6f791dc into 4.x Apr 29, 2026
10 checks passed
@DavertMik DavertMik deleted the feat/screencast-plugin branch April 29, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant