All docs

QA & Testing

Regression detection, test generation, Immune System, QA dashboard.

Overview

UIX Protocol treats QA as a first-class concern — not a bolt-on. The Immune System embeds testing metadata directly in the schema, and the QA engine detects regressions at the semantic level.

Regression detection

The @uix/qa-engine compares two UIXDocuments and detects regressions across 8 categories:

CategoryWhat it detects
LayoutWidth, height, padding, gap changes
ColorBackground, foreground, border color shifts
TypographyFont size, weight, family, line height
VisibilityOpacity, display, hidden state changes
SemanticType changes, role changes, name changes
AccessibilityMissing labels, contrast degradation, role removal
SpacingMargin, gap, padding inconsistencies
InteractionEvent handler changes, disabled state
typescript
import { RegressionDetector } from '@uix/qa-engine';

const detector = new RegressionDetector();
const regressions = detector.detect(oldDoc, newDoc);
// [{ category: 'color', severity: 'high', nodeId: 'btn-1', ... }]

Test generation

The engine generates Playwright test code from document comparisons:

typescript
import { TestGenerator } from '@uix/qa-engine';

const generator = new TestGenerator();
const tests = generator.generate(regressions, document);
// Playwright test script as string

Selector strategy

4-tier selector generation for reliable test targeting:

  1. data-testid — most stable
  2. ARIA role + label — accessible and meaningful
  3. CSS selector — fallback
  4. XPath — last resort

Immune System

QA metadata lives in the schema itself:

json
{
  "extensions": {
    "qa": {
      "coverageStatus": "covered",
      "regressionRisk": "high",
      "lastTestedVersion": "1.2.0",
      "testIds": ["test-btn-click", "test-btn-disabled"]
    }
  }
}

Blueprint-level test hints guide test generators:

typescript
const hints = getTestHints(registry, 'Button');
// { selector, properties, assertions, interaction }

QA Dashboard (Catalyst)

@uix/catalyst is a visual dashboard for QA:

  • Overview — total regressions, coverage %, health score
  • Regressions — filterable list with severity and category
  • Tests — generated test suites with copy-to-clipboard
  • Coverage — per-node coverage heat map
  • Telemetry — OTEL-aligned spans, logs, and metrics
  • CI — pipeline status, quality gate, deployment health