Skip to content

feat(test): add route-level visual regression coverage across locales and themes (#220) - #231

Merged
truthixify merged 11 commits into
wraith-protocol:developfrom
khoap1220-hue:feat/visual-regression-coverage-220
Nov 23, 2026
Merged

truthixify merged 11 commits into
wraith-protocol:developfrom
khoap1220-hue:feat/visual-regression-coverage-220

Conversation

@khoap1220-hue

@khoap1220-hue khoap1220-hue commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

In playwright.config.ts, playwright.visual.config.ts, and tests/visual/, Playwright previously ran e2e-chromium and a11y-chromium with reporter: 'html' and default test-results/ output without route-level visual regression coverage across locales, themes, and viewports.

Summary of Changes

  1. Full 28-Route Visual Inventory & Locale/Theme/Viewport Matrix (tests/visual/route-inventory.ts, tests/visual/routes.visual.spec.ts):

    • Catalogs and baselines all 28 <Route> patterns declared in src/App.tsx (enforced by unit parity check in tests/visual-regression.test.ts) across reusable layout families (landing-home, protocol-showcase, program-accordion, editorial-index, editorial-detail, editorial-archive, author-profile, card-catalog, case-study-detail, interactive-tool, responsive-table, responsive-matrix-table, telemetry-dashboard, status-telemetry, standalone-form, team-governance, leaderboard-grid, brand-press-kit, partner-ecosystem-grid, milestone-timeline, privacy-comparison-legal, security-disclosures, minimal-standalone, standard-layout-page, error-fallback).
    • Programmatically resolves the longest translated locale from src/i18n/*.json (resolveLongestTranslatedLocale() -> es at 11,648 UI chars vs pt at 11,512 UI chars) alongside en, generating 148 reviewed Ubuntu Chromium baselines in tests/visual/__screenshots__/ across desktop (1280x800) and mobile (390x844) widths and dark/light themes.
  2. Deterministic Stabilization & Narrow Dynamic Masking (tests/visual/stabilize.ts):

    • Freezes page.clock to 2026-01-15T12:00:00.000Z (UTC), stubs nondeterministic PerformanceObserver live RUM overrides on /vitals, disables CSS animations/transitions/marquee/pulse, triggers IntersectionObserver ([data-reveal]) and React.lazy chunks, waits for self-hosted .woff2 fonts (document.fonts.ready), and intercepts Soroban RPC (getHealth/getEvents), Plausible, status/uptime endpoints, and external avatars with deterministic fixtures.
    • Masks only leaf dynamic counter elements (StellarMetrics live counts, TrustStrip live uptime figure, /vitals rolling axis dates, and optional env-gated /status poll timestamp/latency) with non-zero match validation on required masks and a strict <= 8% viewport-area guard on each mask.
  3. Changed-Region Attribution & Zero Outside-Baseline Runtime Artifacts (tests/visual/region-diff.ts, tests/visual/visual-reporter.ts, playwright.config.ts, .github/workflows/ci.yml):

    • Decodes PNG scanlines via node:zlib on screenshot mismatch to compute the diff bounding box, prunes broad wrapper containers, attributes vertical layout shifts to the shift-origin DOM region (header, hero, compare-table, stellar-deployment-table, threat-model-matrix, vitals-rolling-chart, footer, etc.), and deduplicates retried checks in VisualRegressionReporter when emitting reports that name route, locale, theme, viewport, and changedRegion.
    • Isolates isVisualCliInvocation(process.argv.slice(2)) in playwright.config.ts, routes Playwright runtime outputDir to os.tmpdir() (removing the tracked test-results/.last-run.json artifact and adding test-results/ + blob-report/ to .gitignore), adds the Playwright Visual Gate job in .github/workflows/ci.yml checking both gitignored runtime directories (playwright-report/, test-results/, blob-report/) and untracked/modified workspace files outside tests/visual/__screenshots__/, and bumps follow-redirects override to 1.16.3 (GHSA-mrwp-f3q8-3g9p) for pnpm audit --prod --audit-level=high.
  4. Visual & Theme Contrast Defects Caught & Resolved During Baseline Review:

    • src/pages/Governance.tsx: Replaced missing /team/*.jpg <img> tags (naturalWidth === 0 broken images) with deterministic initials badges matching src/pages/About.tsx.
    • src/pages/Contributors.tsx, src/pages/Chains.tsx, src/pages/Vitals.tsx, src/pages/Status.tsx, src/pages/Security.tsx: Replaced raw dark-only palette hexes and non-token classes with design-system tokens (text-on-surface, text-on-surface-variant, text-tertiary, bg-tertiary-10, text-error, bg-error-10, bg-surface-container, border-outline-variant) for WCAG AA contrast across both dark and light themes, plus avatar fallback on Contributors.tsx.
    • src/components/Chains.tsx: Fixed 22px horizontal document overflow on 390x844 mobile (/ and /es) caused by an unwrapped three-item flex header inside grid-cols-2 cards, updating public/sitemap.xml for touched page sources.

Verification

  • pnpm format:check, pnpm lint:i18n, pnpm validate:content, pnpm check:sitemap, pnpm validate:jsonld, pnpm audit --prod --audit-level=high
  • pnpm build, pnpm test:a11y, pnpm test:smoke, vitest run tests/visual-regression.test.ts (12/12 unit tests passing)
  • pnpm test:visual (148/148 route/locale/theme/viewport baselines passing across all 28 routes with zero broken images, zero horizontal overflow, zero light/dark contrast regressions, and zero workspace runtime artifacts)

Closes #220

…fects

Add deterministic Playwright visual coverage across desktop and mobile
widths, dark and light themes, and en plus longest translated locale es.
Fix Governance missing team images, Contributors light-theme contrast,
and Chains mobile card overflow while keeping runtime artifacts outside
the repository.

Refs wraith-protocol#220
Add reviewed Ubuntu Chromium visual baselines (part 1 of 5).
Add reviewed Ubuntu Chromium visual baselines (part 2 of 5).
Add reviewed Ubuntu Chromium visual baselines (part 3 of 5).
Add reviewed Ubuntu Chromium visual baselines (part 4 of 5).
Add reviewed Ubuntu Chromium visual baselines (part 5 of 5).

Closes wraith-protocol#220
@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@khoap1220-hue is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 20, 2026

Copy link
Copy Markdown

@khoap1220-hue Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…28-route coverage

Harden CI runtime artifact detection for gitignored Playwright report directories,
isolate visual CLI invocation in playwright.config.ts, deduplicate retried checks
in VisualRegressionReporter, refine layout-shift origin attribution in region-diff,
fix light-theme contrast tokens in Chains/Vitals/Status/Security, and enroll all
28 App routes (148 baselines).

Refs wraith-protocol#220
Add reviewed Ubuntu Chromium baselines for newly enrolled route families (part 1 of 2).
Add reviewed Ubuntu Chromium baselines for newly enrolled route families (part 2 of 2).

Refs wraith-protocol#220
@truthixify
truthixify merged commit 264655c into wraith-protocol:develop Nov 23, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wave 11] Add route-level visual regression coverage across locales and themes

2 participants