Skip to content

UX UI Quality Checks for Developers

Paulo Gomes da Cruz Junior edited this page Nov 30, 2026 · 1 revision

UI/UX Quality Checks for Developers

How style, token, accessibility, and Lighthouse findings reach the CI report. The runner records structured events during a Playwright test; the reporter validates, aggregates, and renders them.

Event pipeline

  1. A step calls a recorder fixture, for example uiux.record(...) or a11y.record(...).
  2. The fixture merges the event with feature, scenario, retry attempt, and timestamp from testInfo.
  3. A Zod schema from playwright/reporters/quality/schema.ts validates the event.
  4. testInfo.attach attaches the valid JSON as quality:a11y, quality:uiux, or quality:lighthouse.
  5. QualityReporter collects the attachments at onTestEnd, summarises them at onEnd, and writes JSON plus markdown under reports/quality/.

Attachments are the handoff between steps and reporting. No global arrays or cy.task() calls are involved.

Event schema

All events share schemaVersion, kind, feature, scenario, attempt, and recordedAt.

Kind Additional fields
a11y url, optional scope, violationCount, and axe violations with impact and help links
uiux event, type, taxonomy, optional severity, property, expected, actual, element, optional selector
lighthouse type, id, name, value, threshold, comparison, passed, severity, taxonomy, url, finalUrl, documentTitle, Lighthouse options and config settings

uiux events use check or violation, with types such as style-check, style-mismatch, token-missing, class-check, and class-mismatch. Lighthouse events record categories and metrics separately.

Style and token checks

resolveElementByTypeAndText locates the element by type and visible text. computedProperty reads the computed CSS value, and valuesMatch normalizes colours and converts between px, rem, and em with a tolerance. getTaxonomy and getSeverity classify the finding.

Assertions use expect.soft, so one style mismatch does not hide the rest of the scenario's findings. Each soft assertion still has a matching recorded event.

Renderers

renderQualityMarkdown calls five renderers in a fixed order:

Renderer Section
summary Totals by kind and outcome
a11y Violations by impact and affected URLs
lighthouse Category and metric results with thresholds
uiux Findings grouped by taxonomy and severity
failures Failed tests and error text

aggregate.ts summarizes test outcomes and merges events across retries. Golden tests under playwright/reporters/quality/ pin rendered markdown, schema parsing, and aggregation behavior. Run them with npm run test:reporters.

Report outputs

Besides the quality JSON and summary.md, playwright.config.ts configures the native list, HTML, JSON, JUnit, GitHub, and playwright-timeline-reporter reporters. In CI, the GitHub annotations and a blob report are added; sharding stays off.

The quality reporter writes summary.md only. A workflow step appends that file to $GITHUB_STEP_SUMMARY once, under if: always(). Artifacts are scanned for credential values and JWT-shaped strings before upload, and trace and video remain off.

File map

File Purpose
playwright/fixtures/quality.ts Base fields and testInfo.attach helper
playwright/fixtures/a11y.fixture.ts axe event recorder
playwright/fixtures/uiux.fixture.ts Style and token event recorder
playwright/fixtures/lighthouse.fixture.ts Lighthouse event recorder
playwright/reporters/quality/schema.ts Zod event schemas and version
playwright/reporters/quality/aggregate.ts Collection and summary logic
playwright/reporters/quality/reporter.ts Playwright reporter implementation
playwright/reporters/quality/renderers/ Markdown section renderers
playwright/support/tokens.ts Token lookup and value comparison

See also

Clone this wiki locally