E2E testing and browser automation for AI-driven development workflows.
Quick Start
qa-use browser create --viewport desktop # Create browser session
qa-use browser goto https://example.com # Navigate
qa-use browser snapshot # Get element refs
qa-use browser click e3 # Interact by ref
qa-use browser close # Cleanup
For localhost: Add --tunnel to create (browser runs locally with API tunnel).
Core Workflow
-
Create session →
qa-use browser create -
Navigate →
qa-use browser goto <url> -
Snapshot →
qa-use browser snapshot(get element refs) -
Interact →
qa-use browser click <ref>/fill <ref> "value" -
Assert/Inspect →
qa-use browser url/screenshot -
Close →
qa-use browser close
Critical: Always run snapshot before interacting to get valid element refs. Never guess refs.
Commands
Browser Session Management
| qa-use browser create
| Create remote browser session
| qa-use browser create --tunnel
| Create local browser with API tunnel
| qa-use browser create --viewport <size>
| Set viewport: desktop, tablet, mobile
| qa-use browser create --ws-url <url>
| Connect to existing WebSocket browser
| qa-use browser create --after-test-id <uuid>
| Run a test first, then become interactive
| qa-use browser create --var <key=value>
| Override app config variables (repeatable)
| qa-use browser list
| List active sessions
| qa-use browser status
| Show current session details (app_url, recording_url, etc.)
| qa-use browser close
| Close active session
Sessions auto-persist in ~/.qa-use.json. One active session = no -s flag needed.
Variable Overrides
Use --var to override app config variables at runtime. Common variables:
| base_url
| Base URL for the app (e.g., preview deployment URL)
| login_url
| Login page URL
| login_username
| Username/email for authentication
| login_password
| Password for authentication
Example with ephemeral preview URL:
qa-use browser create --after-test-id <login-test-uuid> \
--var base_url=https://preview-123.example.com \
--var login_url=https://preview-123.example.com/auth/login
Navigation
| qa-use browser goto <url>
| Navigate to URL
| qa-use browser back
| Go back
| qa-use browser forward
| Go forward
| qa-use browser reload
| Reload page
Element Interaction
| qa-use browser click <ref>
| Click element by ref
| qa-use browser click --text "Button"
| Click by semantic description
| qa-use browser fill <ref> "value"
| Fill input field
| qa-use browser type <ref> "text"
| Type with delays (for autocomplete)
| qa-use browser press <key>
| Press key (e.g., Enter, Tab)
| qa-use browser check <ref>
| Check checkbox
| qa-use browser uncheck <ref>
| Uncheck checkbox
| qa-use browser select <ref> "option"
| Select dropdown option
| qa-use browser hover <ref>
| Hover over element
| qa-use browser scroll down 500
| Scroll by pixels
| qa-use browser scroll-into-view <ref>
| Scroll element into view
| qa-use browser drag <ref> --target <ref>
| Drag element to target
| qa-use browser mfa-totp [ref] <secret>
| Generate TOTP code (optionally fill)
| qa-use browser upload <ref> <file>...
| Upload file(s) to input
Inspection
| qa-use browser snapshot
| Get ARIA tree with element refs
| qa-use browser url
| Get current URL
| qa-use browser screenshot
| Save screenshot.png
| qa-use browser screenshot file.png
| Save to custom path
| qa-use browser screenshot --base64
| Output base64 to stdout
Logs
| qa-use browser logs console
| View console logs from session
| qa-use browser logs console -s <id>
| View logs from specific/closed session
| qa-use browser logs network
| View network request logs
| qa-use browser logs network -s <id>
| View network logs from specific session
Test Generation
| qa-use browser generate-test
| Generate test YAML from recorded session
| qa-use browser generate-test -s <id>
| Generate from specific session
| qa-use browser get-blocks
| Get recorded interaction blocks
Waiting
| qa-use browser wait <ms>
| Fixed wait
| qa-use browser wait-for-selector ".class"
| Wait for selector
| qa-use browser wait-for-load
| Wait for page load
Test Operations
| qa-use test run <name>
| Run test by name
| qa-use test run --all
| Run all tests
| qa-use test run <name> --tunnel
| Run with local browser tunnel
| qa-use test run <name> --autofix
| Enable AI self-healing
| qa-use test run <name> --update-local
| Persist AI fixes to file
| qa-use test run <name> --download
| Download assets to /tmp/qa-use/downloads/
| qa-use test run <name> --var key=value
| Override variable
| qa-use test validate <name>
| Validate test syntax
| qa-use test list
| List available tests
| qa-use test info <name>
| Show test details (steps, tags, description)
| qa-use test info --id <uuid>
| Show cloud test details by ID
| qa-use test runs [name]
| List test run history
| qa-use test runs --id <uuid>
| Filter runs by test ID
| qa-use test runs --status failed
| Filter runs by status
| qa-use test init
| Initialize test directory
| qa-use test sync --pull
| Pull tests from cloud
| qa-use test sync --push
| Push tests to cloud
| qa-use test sync --push --force
| Push tests, overwriting conflicts
| qa-use test diff <file>
| Compare local vs cloud test
Common Mistakes
| browser navigate <url>
| browser goto <url>
| browser destroy
| browser close
| browser close <session-id>
| browser close
| browser goto --session <id> <url>
| browser -s <id> goto <url>
| browser screenshot --output file.png
| browser screenshot file.png
Test Format Overview
name: Login Test
description: Validates login functionality with valid credentials
tags:
- smoke
- auth
app_config: <app-config-id>
variables:
email: test@example.com
password: secret123
depends_on: setup-test # Optional
steps:
- action: goto
url: /login
- action: fill
target: email input
value: $email
- action: click
target: login button
- action: to_be_visible
target: dashboard
See references/test-format.md for full specification.
Failure Debugging
When tests fail, classify the issue:
| CODE BUG | Feature doesn't work, JS errors, API failures | Fix application code
| TEST BUG
| Selector changed, timing issue, assertion value outdated
| Update test or use --autofix
| ENVIRONMENT | Network timeout, auth expired, missing data | Check services, retry
See references/failure-debugging.md for detailed diagnostics.
Localhost Testing
The cloud cannot access localhost. Use tunnels:
# Option 1: Tunnel flag with test run
qa-use test run my-test --tunnel
# Option 2: Persistent tunnel session
qa-use browser create --tunnel # Starts local browser
# Copy WebSocket URL from output
qa-use test run my-test --ws-url <websocket-url>
See references/localhost-testing.md for details.
Deep-Dive References
| browser-commands.md | Complete browser CLI reference with all flags
| test-format.md | Full test YAML specification
| localhost-testing.md | Tunnel setup for local development
| failure-debugging.md | Failure classification and diagnostics
Templates
| basic-test.yaml | Simple navigation and assertion
| auth-flow.yaml | Login flow with credentials
| form-test.yaml | Form submission with validation
npx Alternative
All commands use qa-use assuming global install. For one-off use:
npx @desplega.ai/qa-use browser <command>