The playwright-interactive skill extends the base Playwright CLI skill with a persistentDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/openai/skills/llms.txt
Use this file to discover all available pages before exploring further.
js_repl session that keeps browser handles alive across multiple code iterations. Instead of opening and closing a browser for each command, you launch once and keep the same page, context, and electronApp objects alive throughout the debugging session — reloading or relaunching only when the code actually changes. This makes rapid iterative QA dramatically faster for local web apps and Electron applications.
When to Use Interactive vs. Headless CLI
Use Playwright CLI (headless)
- Scripted, repeatable browser automation
- Form filling, navigation, screenshots, and data extraction
- One-shot tasks that don’t need persistent state
- CI pipelines and batch workflows
- Any task where
$PWCLI snapshot+clickcovers your needs
Use Playwright Interactive
- Iterative UI debugging of a local web or Electron app
- Keeping browser handles alive across multiple code changes
- Visual QA with functional and screenshot-based signoff
- Desktop and mobile viewport comparisons in a single session
- Electron app debugging where
js_replowns the process
Prerequisites
Playwright Interactive requires
js_repl to be enabled and Codex to be started with --sandbox danger-full-access. This is a temporary requirement while js_repl + Playwright sandbox support is being completed.js_repl in ~/.codex/config.toml:
js_repl, start a new Codex session so the tool list refreshes.
One-Time Setup
Run once per workspace directory before using the skill:How It Differs from the CLI Skill
| Feature | Playwright CLI | Playwright Interactive |
|---|---|---|
| Session persistence | Each command is stateless | Handles (page, context, electronApp) stay alive |
| Iteration speed | Re-opens browser per session | Reload or relaunch only when code changes |
| Electron support | Not supported | Full _electron.launch() support via js_repl |
| Mobile emulation | Not supported | Desktop + mobile contexts in the same session |
| Visual QA | Screenshots via $PWCLI screenshot | Structured QA inventory, multi-pass visual signoff |
| Sandbox requirement | Works in standard sandbox | Requires --sandbox danger-full-access |
| Setup | npx-based, no extra install | npm install playwright per workspace |
Core Session Loop
Bootstrap js_repl once
Run the bootstrap cell to load Playwright and declare shared handles. Use
var so later cells can reuse the same bindings.Make code changes, then reload
For renderer-only changes, reload without relaunching:For Electron main-process or startup changes, relaunch the app:
Run functional and visual QA
Work through a shared QA inventory covering every user-visible control and state. Use real user input (keyboard, mouse, touch) — not
page.evaluate() — for signoff checks.Session Modes
The skill supports three distinct session modes. Choose based on your testing goal:Explicit viewport (default)
Use for routine iteration, breakpoint checks, reproducible screenshots, and snapshot diffs. Stable across machines.
Native-window mode
Use
viewport: null for a separate headed pass to validate launched window size, OS-level DPI, or browser chrome interactions.Electron mode
Launch through
_electron.launch(). Assumes native-window behavior. Check as-launched size and layout before resizing.Mobile Emulation
Add a mobile context alongside your desktop context in the same session:Common Failure Modes
| Error | Fix |
|---|---|
Cannot find module 'playwright' | Run the one-time setup in the current workspace |
| Browser executable missing | npx playwright install chromium |
net::ERR_CONNECTION_REFUSED | Confirm dev server is running; prefer http://127.0.0.1:<port> |
electron.launch hangs | Verify local electron dep; ensure renderer dev server is running first |
Identifier has already been declared | Reuse existing top-level bindings; use js_repl_reset only if the kernel is stuck |
| Browser ops fail immediately | Confirm session started with --sandbox danger-full-access |