| name | test-page |
| argument-hint | <url> |
| description | Test a page or user flow using Playwright CLI. Navigate to a URL, interact with elements, take snapshots, and verify behavior. Use when you need to visually check a page, test a form, verify a user flow, or debug UI issues. |
Test Page
Use the playwright-cli (Bash tool) to navigate to a page, interact with it, take snapshots, and verify it works correctly.
IMPORTANT: Never use the Playwright MCP. Always use playwright-cli via the Bash tool.
Required Input
- URL: The page URL (e.g.,
http://localhost:3001/validate or a Vercel deployment URL)
Instructions
1. Open the Browser and Navigate
playwright-cli open <url>
This opens a headless browser and navigates to the URL. It returns a page snapshot with element refs.
2. Take a Snapshot
playwright-cli snapshot
Read the snapshot YAML file to see the page structure and find element refs (e.g., e11, e14).
3. Interact and Verify
All interactions use element refs from the snapshot:
playwright-cli fill <ref> "<text>"
playwright-cli click <ref>
playwright-cli select <ref> "<value>"
playwright-cli upload <file-path>
playwright-cli type "<text>"
playwright-cli goto <url>
playwright-cli console
After each interaction, run playwright-cli snapshot to see the updated page state and get new element refs.
4. Common Test Flows
Login Flow
playwright-cli open http://localhost:3001/login
- Read snapshot to find email/password field refs
playwright-cli fill <email-ref> "jenny.park@ttb.gov"
playwright-cli fill <password-ref> "specialist123"
playwright-cli click <submit-ref>
playwright-cli snapshot — verify dashboard loaded
Validate Label Flow
- Login first (see above)
playwright-cli goto http://localhost:3001/validate
playwright-cli snapshot — find form field refs
- Select beverage type, upload label image, fill fields
- Click "Validate"
sleep 5 && playwright-cli snapshot — verify results with annotated image
Review Queue Flow
- Login first
playwright-cli goto http://localhost:3001/review
playwright-cli snapshot — verify queue table with pending items
- Click first item
playwright-cli snapshot — verify review detail with override controls
5. Assess Results
After taking snapshots:
- Check the snapshot YAML for correct page structure and content
- Verify status badges show correct text
- Check that forms have proper labels
- Run
playwright-cli console to check for errors
- Verify navigation works (links go to correct pages)
6. Clean Up
playwright-cli close
Test Users
Tips
- After each interaction, run
playwright-cli snapshot to get updated element refs
- Element refs change after page updates — always use refs from the latest snapshot
- If the dev server isn't running, ask the user to start it with
yarn dev
- For deployed URLs that return 403, use
vercel CLI's get_access_to_vercel_url first
- Use
playwright-cli console to check for JavaScript errors
- Use
playwright-cli network to debug failed API calls