Skip to content

feat: Automated Visual Regression Testing Pipeline (#67) - #73

Merged
elizabetheonoja-art merged 6 commits into
Utility-Protocol:mainfrom
Kami-no-san:fix/issue-67-visual-regression-pipeline
Jun 24, 2026
Merged

feat: Automated Visual Regression Testing Pipeline (#67)#73
elizabetheonoja-art merged 6 commits into
Utility-Protocol:mainfrom
Kami-no-san:fix/issue-67-visual-regression-pipeline

Conversation

@Kami-no-san

Copy link
Copy Markdown
Contributor

Summary

Implements Issue #67: Automated Visual Regression Testing Pipeline with PixelMatch and Playwright Screenshots for CI.

Changes

  • Dependencies: Added pixelmatch, pngjs, @types/pngjs, and tsx
  • tests/visual/config.ts: Viewports (mobile/tablet/desktop), thresholds, route map, PixelMatch settings
  • tests/visual/utils/screenshot.ts: Freezes CSS animations, masks dynamic content, takes full-page screenshots
  • tests/visual/utils/compare.ts: PixelMatch wrapper producing diff PNGs with ratio comparison
  • tests/visual/visual.spec.ts: Per-route full-page snapshots AND per-component isolated screenshots across all 3 viewports. Missing baselines skip gracefully.
  • tests/visual/reportGenerator.ts: HTML report with side-by-side baseline/screenshot/diff images
  • scripts/update-baselines.ts: npm run visual:update-baselines copies current results to baselines/
  • .github/workflows/visual-regression.yml: CI workflow — runs on PR to main, uploads artifacts, posts PR comment
  • playwright.config.ts: Added chromium + webkit projects

Closes #67

…h and Playwright (Issue Utility-Protocol#67)

- Add pixelmatch and pngjs dev dependencies for screenshot comparison
- Create tests/visual/config.ts with viewports, thresholds, and route config
- Implement screenshot helper with CSS animation freezing and dynamic element masking
- Build PixelMatch compare wrapper with baseline/diff PNG generation
- Write visual.spec.ts covering full-page and per-component screenshots at 3 viewports
- Generate HTML visual regression report with side-by-side image comparison
- Create update-baselines.ts script for baseline seed/promotion
- Add .github/workflows/visual-regression.yml CI workflow with PR comments
- Configure Playwright projects for chromium (primary) and webkit (secondary)
- Add npm scripts: test:visual and visual:update-baselines
@elizabetheonoja-art

Copy link
Copy Markdown
Contributor

ci failed

…tion)

- Create dedicated playwright.visual.config.ts with testDir: ./tests/visual
  so visual tests are discovered independently of E2E test config
- Update visual-regression.yml to use the new config file
- Add continue-on-error to Post PR comment step (fork PRs lack write access)
- Fix FleetGrid hydration mismatch by suppressing warnings on the
  randomly-generated demo data grid (Math.random() differs SSR vs client)
…de violation when multiple canvas elements exist

@elizabetheonoja-art elizabetheonoja-art left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elizabetheonoja-art
elizabetheonoja-art merged commit b43d893 into Utility-Protocol:main Jun 24, 2026
4 checks passed
@Kami-no-san

Copy link
Copy Markdown
Contributor Author

Yes sir🫡

@Kami-no-san
Kami-no-san deleted the fix/issue-67-visual-regression-pipeline branch June 24, 2026 20:58
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.

Automated Visual Regression Testing Pipeline with PixelMatch and Playwright Screenshots for CI

2 participants