Skip to content

Add Playwright visual regression snapshot tests - #674

Open
ellaevans2323-pixel wants to merge 1 commit into
StellarFlow-Network:mainfrom
ellaevans2323-pixel:feat/603-visual-regression-tests
Open

Add Playwright visual regression snapshot tests#674
ellaevans2323-pixel wants to merge 1 commit into
StellarFlow-Network:mainfrom
ellaevans2323-pixel:feat/603-visual-regression-tests

Conversation

@ellaevans2323-pixel

Copy link
Copy Markdown

Summary

  • Adds e2e/visual.spec.ts: full-page pixel-diff screenshot tests of the landing page at the three core responsive breakpoints (Mobile 375px, Tablet 768px, Desktop 1440px), with animations/transitions frozen before each capture for deterministic diffs.
  • Configures expect.toHaveScreenshot in playwright.config.ts with a 2% max pixel-diff ratio tolerance.
  • Adds test:e2e, test:visual, and test:visual:update npm scripts (the latter for regenerating baselines locally).
  • Updates .github/workflows/e2e.yml to cache Playwright's browser binaries and to persist visual baseline snapshots via a keyed actions/cache entry — first CI run auto-creates baselines, subsequent runs diff against them — plus uploads diff artifacts on failure for debugging.

Closes #603

Notes

  • This repo's build currently fails on main independent of this change (ErrorBoundary is not exported from src/components/ui/index.ts, referenced by src/app/DashboardInteractive.tsx), which also blocks npm run build in the existing e2e CI job. That's a pre-existing issue outside the scope of 🧪 Visual-Regression | Automated Playwright Visual Regression Snapshot Tests #603 — worth a follow-up fix so this workflow (and the new visual tests) can actually run in CI.
  • No baseline PNGs are committed in this PR; per the design above they're generated by CI on first run and cached, or can be generated locally with npm run test:visual:update once the build issue above is resolved.

Test plan

  • npx eslint e2e/visual.spec.ts playwright.config.ts passes
  • npx tsc --noEmit shows no new type errors
  • npm run test:visual locally once the unrelated build failure noted above is fixed

Adds pixel-diff visual regression coverage for the landing page across
the core responsive breakpoints (Mobile 375px, Tablet 768px, Desktop
1440px) using Playwright's built-in screenshot comparison. Animations
and transitions are frozen before each capture to keep diffs
deterministic across runs.

Configures a 2% max pixel-diff ratio tolerance in playwright.config.ts,
and adds test:visual / test:visual:update npm scripts for generating
and refreshing baselines locally. CI now caches Playwright's browser
binaries and persists visual baseline snapshots as a keyed cache
artifact (auto-created on first run, diffed against on subsequent
runs), with diff artifacts uploaded on failure for debugging.

Closes StellarFlow-Network#603
@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@ellaevans2323-pixel 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

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.

🧪 Visual-Regression | Automated Playwright Visual Regression Snapshot Tests

1 participant