Skip to content

Configuration

UI QA is configured through environment variables. This page documents all available options and their defaults.

API Key

An OpenRouter API key is required.

Setting the Key

bash
export OPENROUTER_API_KEY=sk-or-v1-your-key-here

Or create a .env file:

ini
OPENROUTER_API_KEY=sk-or-v1-your-key-here

Security

Add .env to .gitignore to avoid committing credentials.

Environment Variables

Required

VariableDescription
OPENROUTER_API_KEYAPI key for LLM access

LLM Model

VariableDefaultDescription
OPENROUTER_MODELTest mode: anthropic/claude-sonnet-4.5
Validation mode: anthropic/claude-sonnet-4
Model identifier used for LLM calls

Test Mode Scope

VariableDefaultDescription
MAX_PAGES20Maximum pages to test (discovery limit)
MAX_SCENARIOS_PER_PAGE5Maximum scenarios generated per page
MAX_STEPS_PER_SCENARIO10Maximum steps executed per scenario
PARALLEL_BROWSERS3Concurrent browser instances (clamped 1-10)
GOALShomepage UX + primary CTA + form validation + keyboardLLM test objectives
HEADLESStrueRun browser headless (false for headed mode)

Validation Mode Scope

Validation mode uses the same environment variables, but defaults differ:

VariableDefault (Validation Mode)Description
MAX_PAGES50Maximum pages to test
MAX_SCENARIOS_PER_PAGE8Maximum scenarios generated per page
MAX_STEPS_PER_SCENARIO14Maximum agent steps per scenario
PARALLEL_BROWSERS5Concurrent browser instances
VALIDATION_GAP_ROUNDS4Iterative uncovered-requirement planning rounds
VALIDATION_GAP_PAGES_PER_ROUND3Max pages targeted per gap round
VALIDATION_MAX_TOTAL_SCENARIOS60Hard cap on total generated scenarios
VALIDATION_ENABLE_PROBEStrueEnable deterministic post-execution probes
VALIDATION_PERF_LOAD_BUDGET_MS2000Performance probe load-time budget
VALIDATION_PERF_UI_BUDGET_MS100Performance probe UI-latency budget

Timeouts

VariableDefaultDescription
BROWSER_TIMEOUT60000General browser timeout (ms)
NAVIGATION_TIMEOUT45000Page load timeout (ms)
ACTION_TIMEOUT15000Click/fill action timeout (ms)
SCENARIO_TIMEOUT_MSmax(BROWSER_TIMEOUT * 4, 180000)Per-scenario timeout in validation mode
LLM_TIMEOUT_MS60000Default timeout for LLM calls
CROSS_VALIDATION_TIMEOUT_MSLLM_TIMEOUT_MS or 90000 fallbackTimeout for validation cross-check requests

Retry Behavior

VariableDefaultDescription
MAX_RETRIES3Retry attempts for transient failures (test mode only)
RETRY_DELAY_MS1000Initial retry delay (doubles each attempt, test mode only)

Debugging

VariableDefaultDescription
DEBUGfalseEnable verbose debug output

Logging

VariableDefaultDescription
JSON_LOGStrueWrite streaming JSON logs to .ui-qa-runs/<run-id>/events.jsonl (false to disable)

Example Configuration

ini
# Required
OPENROUTER_API_KEY=sk-or-v1-your-key-here

# Model
OPENROUTER_MODEL=anthropic/claude-sonnet-4.5

# Test scope
MAX_PAGES=25
MAX_SCENARIOS_PER_PAGE=6
MAX_STEPS_PER_SCENARIO=12
PARALLEL_BROWSERS=4
GOALS=navigation + forms + mobile responsiveness
HEADLESS=true

# Timeouts
BROWSER_TIMEOUT=60000
NAVIGATION_TIMEOUT=45000
ACTION_TIMEOUT=15000
SCENARIO_TIMEOUT_MS=180000
LLM_TIMEOUT_MS=60000
CROSS_VALIDATION_TIMEOUT_MS=90000

# Retries
MAX_RETRIES=3
RETRY_DELAY_MS=1000

# Logging
JSON_LOGS=true

# Debug
DEBUG=false

CI/CD Integration

yaml
- name: Run UI QA
  env:
    OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
    MAX_PAGES: 10
    PARALLEL_BROWSERS: 2
  run: npx @usharma124/ui-qa https://staging.example.com

Released under the MIT License.