Below is the three-stage pipeline that keeps every Playwright script faithful to the recordings while remaining resilient to UI drift.
Scene-detection finds motion spikes, then we hand-trim to the decisive UI states while preserving aspect ratio and ≤30 KB budgets.
Vision + UI models narrate deltas between frames so we can map each pause to a DOM element, selector strategy, and assumption.
Specs replay the action order with 2–3 s pacing, adaptive waits, and safety nets for ad skips, modal dismissals, or dice re-rolls.
We validated these commands using the existing
playground-pro/script.spec.ts in the repo. Replace playground-pro with any other folder that
contains a spec you created.
npx playwright install --with-deps chromium
npm install -D @playwright/test, otherwise npx works fine.
npx playwright test playground-pro/script.spec.ts --browser=chromium --headed
playground-pro with your own folder (e.g.,
my-test/script.spec.ts).
PWDEBUG=1 npx playwright test playground-pro/script.spec.ts --browser=chromium --headed
PWDEBUG=1 replays the script step-by-step
(useful when you just need to watch it, no video required).