Repository navigation
UX UI 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.
- A step calls a recorder fixture, for example
uiux.record(...)ora11y.record(...). - The fixture merges the event with feature, scenario, retry attempt, and timestamp from
testInfo. - A Zod schema from
playwright/reporters/quality/schema.tsvalidates the event. -
testInfo.attachattaches the valid JSON asquality:a11y,quality:uiux, orquality:lighthouse. -
QualityReportercollects the attachments atonTestEnd, summarises them atonEnd, and writes JSON plus markdown underreports/quality/.
Attachments are the handoff between steps and reporting. No global arrays or cy.task() calls are involved.
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.
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.
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.
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 | 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 |
- UI/UX Quality Checks — designer-facing overview.
- Playwright Developer Guide — reporters and CI gate.
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository