Browser Command
Open browser for E2E testing using playwright-cli.
Target URL: $ARGUMENTS
If no URL provided, default to: http://localhost:${DEFAULT_PORT:-5173}/
Pre-Flight Checks
- Verify playwright-cli Installed
- Run:
playwright-cli --help - If not available: STOP with error "playwright-cli not installed. Run: npm install -g @playwright/cli@latest && playwright-cli install-browser"
- Run:
Execution
Navigate to URL
playwright-cli open "${URL:-http://localhost:${DEFAULT_PORT:-5173}/}"Verify Page Load
playwright-cli snapshotReport page title and URL from snapshot output.
Report Status
- Confirm browser is open and ready
- Display current page title
- Display current URL
Available CLI Commands
After opening browser, these commands are available via Bash:
playwright-cli goto <url>- Navigate to URLplaywright-cli snapshot- Capture accessibility snapshotplaywright-cli click "<selector>"- Click elementplaywright-cli fill "<selector>" "<text>"- Fill input fieldplaywright-cli type "<text>"- Type textplaywright-cli screenshot- Take PNG screenshotplaywright-cli close- Close browser sessionplaywright-cli video-start/video-stop- Record video
Notes
- Video recording is explicit: use
playwright-cli video-startbefore the flow andvideo-stopafter - Configure output via
playwright-cli.jsonin project root - Use
--headedflag for visible browser window:playwright-cli --headed open <url> - Port can be configured via DEFAULT_PORT environment variable
- Sessions persist across commands: use
playwright-cli -s=<name>for named sessions