Drive a real browser from the terminal using playwright-cli or a bundled wrapper script for navigation, form filling, snapshots, screenshots, data extraction, and UI-flow debugging.
Tasks
Navigate to a URL, snapshot the page for element refs, click an element, fill a form field, and re-snapshot after the DOM changes
Debug a UI flow by opening a page in headed mode and capturing start/stop traces
Inputs
URLs to open via the wrapper or CLI
Element refs (e.g., e1, e3, e15) from the latest snapshot
Text to type or fill into form fields
Keys to press (e.g., Enter)
Outputs
Page snapshots containing stable element refs
Screenshots and PDF artifacts
Traces captured via tracing-start and tracing-stop
Limitations and checks
Element refs can go stale after navigation, substantial UI changes, modal open/close, or tab switches
Do not pivot to @playwright/test unless the user explicitly asks for test files
Default to CLI commands and workflows, not Playwright test specs
When a fresh snapshot is unavailable, use placeholder refs like eX and explain why
Verify npx is available by running: command -v npx >/dev/null 2>&1
Ensure PWCLI points to the wrapper script at $CODEX_HOME/skills/playwright/scripts/playwright_cli.sh before invoking any browser command
Confirm a snapshot was taken before referencing any element id such as e12, and re-snapshot after navigation or significant DOM changes
Verify artifacts are written under output/playwright/ without introducing new top-level artifact folders