Skip to content

Usage

This page covers command-line options, execution phases, and output formats.

Command Line

bash
ui-qa <url> [options]

Options

OptionDescription
--goals <string>Testing objectives (overrides environment variable)
--help, -hDisplay help

Examples

bash
# Basic usage
npx @usharma124/ui-qa https://example.com

# Custom goals
npx @usharma124/ui-qa https://shop.example.com --goals "checkout flow, payment forms"

# Accessibility focus
npx @usharma124/ui-qa https://example.com --goals "keyboard navigation, screen reader support"

Interactive Mode

Running without a URL launches the interactive interface:

bash
npx @usharma124/ui-qa

Keyboard Controls

KeyAction
EnterSubmit / Continue
/ Scroll logs
rRetry on error
qQuit

Execution Phases

Init

Opens a headless browser and captures an initial screenshot.

Discovery

Locates pages through:

  • sitemap.xml parsing
  • robots.txt sitemap references
  • Recursive link crawling

Planning

The LLM analyzes each page and generates a test plan:

  • Identifies interactive elements
  • Sequences test actions
  • Incorporates specified goals

Execution

Runs tests using Playwright across multiple viewports:

  • Desktop (1365×768), Tablet (820×1180), Mobile (390×844)
  • Clicks, form submissions, navigation
  • Screenshot capture before and after each action
  • Automatic retry with exponential backoff on failures
  • Console and error logging

Evaluation

The LLM reviews all evidence and produces:

  • Quality score (0–100)
  • Categorized issues
  • Reproduction steps
  • Fix recommendations

Output Structure

Results are written to .ui-qa-runs/<run-id>/:

.ui-qa-runs/
└── cli-1234567890/
    ├── run.json
    ├── report.json
    ├── evidence.json
    ├── report.md
    ├── llm-fix.txt
    └── screenshots/

File Reference

FileContents
run.jsonRun metadata and status
report.jsonStructured report with scores and issues
evidence.jsonDetailed execution data
report.mdHuman-readable summary
llm-fix.txtInstructions for automated fixes
screenshots/Visual evidence

Report Schema

json
{
  "score": 85,
  "summary": "...",
  "issues": [
    {
      "severity": "high",
      "category": "accessibility",
      "title": "Missing form labels",
      "description": "...",
      "reproduction": ["..."],
      "suggestion": "..."
    }
  ]
}

Issue Categories

CategoryDescription
accessibilityARIA, keyboard navigation, screen readers
usabilityUX problems, confusing flows
functionalityBroken features, errors
performanceLoading, animations
visualLayout, responsive design

Severity Levels

LevelDescription
criticalSite unusable
highSignificant impact
mediumNotable issues
lowMinor improvements

Safety

UI QA is designed for safe operation:

  • Uses dummy data for forms (test@example.com)
  • Does not submit payment forms
  • Redacts sensitive data before LLM processing
  • Enforces timeouts on all operations

Debugging

Enable verbose output:

bash
DEBUG=true npx @usharma124/ui-qa https://example.com

Score Interpretation

RangeAssessment
90–100Excellent
70–89Good
50–69Fair
Below 50Needs attention

Released under the MIT License.