feat(plugins): unify screenshot/pause/aiTrace/heal under shared on= parameter#5542
Merged
feat(plugins): unify screenshot/pause/aiTrace/heal under shared on= parameter#5542
Conversation
…arameter Adds a shared lib/utils/pluginParser.js with key=value parsing (`:` and `;` separators) and a `resolveTrigger` helper. Renames screenshotOnFail → screenshot and consolidates pauseOn/pauseOnFail → pause; aiTrace and heal grow `on=` filters. Old plugin names live on as deprecated alias shims that warn and forward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…shot - Remove lib/plugin/pauseOn.js (never shipped in a public release). - Remove lib/plugin/stepByStepReport.js; slideshow generation moves into the screenshot plugin behind slides=true (e.g. -p screenshot:on=step;slides=true) with a modern, vanilla-CSS dark UI — no Bootstrap, no jQuery. - Drop the redundant screenshot blocks from the acceptance test configs; the default in lib/config.js already enables screenshot with on=fail. - Strip allure mentions from plugin code and plugin docs; refresh PR template, migration guide, debugging guide, plugins index, and commands docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
resolveTrigger now takes { name, validModes }, performs the unknown-mode
and missing-path/pattern checks itself, prints the error via output.error,
and returns null. Each plugin shrinks to one call + early-return; heal
passes its narrower mode list as { validModes: ['fail', 'file', 'url'] }.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
DavertMik
added a commit
that referenced
this pull request
Apr 29, 2026
* feat(plugins): add screencast plugin (replaces subtitles) 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. * Apply suggestion from @DavertMik * Apply suggestion from @DavertMik * fix(playwright): port React locator off removed _react= engine; drop Vue 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) --------- Co-authored-by: DavertMik <davert@testomat.io>
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
screenshot,pause,aiTrace,heal) under oneon=trigger system:fail | test | step | file | url. CLI form is-p plugin:on=mode:key=value:key=value(or;to inline-group sub-keys likepath+line); config form is the equivalent object.lib/utils/pluginParser.js(parsePluginArgs,resolveTrigger,matchStepFile,matchUrl,getBrowserHelper) — replaces duplicated parsing/matching code across the four plugins.screenshotOnFail→screenshotand consolidatespauseOn+pauseOnFail→pause; old names remain as deprecated alias shims that warn and forward (positional CLI args translate to the newon=key:param=valuesyntax).Behavior
onfailfailstepfailheal:on=stepandheal:on=testare rejected with a clear error.CLI examples
Companion change
@codeceptjs/configuresetCommonPluginsis updated to register the new plugin names with their on= defaults; old keys are removed there (the alias shims still load if a user references them directly).Test plan
npx mocha test/unit --recursive— 611 passing, no plugin regressionsscreenshotOnFailandaiTraceunit tests pass through the alias / new code path unchangedPlugins: screenshot, retryFailedStep, pause, heal)-p screenshot:on=file(missingpath=) prints the expected error🤖 Generated with Claude Code