| name | qa-browse |
| description | Drive a real browser from the CLI to QA a flow — navigate, click, fill, verify. Uses @playwright/cli (token-efficient, not MCP). Use with /qa-browse when the user wants to manually check a web flow works, not write a test suite. |
| argument-hint | <url> <what to verify> |
QA Browse — CLI browser driving with @playwright/cli
/qa-browse opens a live browser via @playwright/cli (binary playwright-cli) and walks a flow to verify it works. No test files. No MCP. This is distinct from the standard Playwright CLI (npx playwright, used for test/codegen/show-trace).
Engine: @playwright/cli (Microsoft). Snapshots live on disk, not in context — cheap tokens. Browser stays alive between commands.
Rules
- If not installed globally, run via the scoped package:
npx @playwright/cli (NOT npx playwright-cli — that resolves the unscoped name and fails with ENOTFOUND). Never assume global.
- Loop: snapshot → read refs → act → re-snapshot. Always.
- Refs (
e5, e12) are valid only for the latest snapshot. Re-snapshot after any navigation/click that changes the page.
- Headless by default. Add
--headed only when a human must watch.
- Prefer refs over CSS. Use
getByRole/getByText selectors only if a ref isn't available.
- Verify with
eval or a snapshot of the result region — don't assume an action worked.
- Screenshot on each pass/fail checkpoint so there's evidence.
close when done.
Setup
npm install -g @playwright/cli@latest
playwright-cli install-browser chromium
Core loop
playwright-cli open <url>
playwright-cli snapshot
playwright-cli click e15
playwright-cli fill e5 "text"
playwright-cli type "text"
playwright-cli press Enter
playwright-cli snapshot
playwright-cli screenshot
playwright-cli close
Interact
playwright-cli click <ref> [button]
playwright-cli dblclick <ref>
playwright-cli fill <ref> <text> --submit
playwright-cli select <ref> <value>
playwright-cli check <ref> / uncheck <ref>
playwright-cli hover <ref>
playwright-cli drag <startRef> <endRef>
playwright-cli upload ./file.pdf
playwright-cli dialog-accept / dialog-dismiss
Navigate
playwright-cli goto <url>
playwright-cli go-back / go-forward / reload
Inspect & verify
playwright-cli snapshot --depth=4
playwright-cli snapshot e34
playwright-cli snapshot --raw | grep button
playwright-cli eval "document.title"
playwright-cli eval "el => el.textContent" e5
playwright-cli eval "el => el.getAttribute('data-testid')" e5
playwright-cli console
Evidence
playwright-cli screenshot --full-page
playwright-cli screenshot e5
playwright-cli screenshot --filename=step1.png
playwright-cli video-start / video-stop
playwright-cli tracing-start / tracing-stop
playwright-cli pdf --filename=page.pdf
Sessions
State (cookies, localStorage) persists within a session across commands.
playwright-cli --session=qa open <url>
playwright-cli -s=qa open <url> --persistent
playwright-cli list
playwright-cli show
playwright-cli close-all / kill-all
QA flow checklist
open <url> → snapshot.
- For each step: find ref in snapshot → act → re-snapshot → verify expected element/text.
screenshot at each checkpoint (pass and fail).
- On failure:
eval the element, capture console, take a --headed re-run or trace.
- Report: what passed, what failed, with screenshot/snapshot paths.
close.
Example — login flow
playwright-cli open https://app.example.com/login
playwright-cli snapshot
playwright-cli fill e1 "user@example.com"
playwright-cli fill e2 "secret" --submit
playwright-cli snapshot
playwright-cli eval "document.title"
playwright-cli screenshot --filename=logged-in.png
playwright-cli close
When NOT to use
- Want a saved, repeatable test suite → use
/tdd or write @playwright/test specs.
- Need long-running autonomous loops or persistent introspection → Playwright MCP may fit better.