Skip to content

Add visual regression tests#9

Merged
gvonness-apolitical merged 2 commits intomainfrom
feature/visual-regression-tests
Feb 1, 2026
Merged

Add visual regression tests#9
gvonness-apolitical merged 2 commits intomainfrom
feature/visual-regression-tests

Conversation

@gvonness-apolitical
Copy link
Copy Markdown
Collaborator

Summary

Add Playwright visual regression tests that capture screenshots and compare against baselines to detect unintended UI changes.

Tests Added

  • PDF rendering - Verifies PDF loads and displays correctly
  • EPUB rendering - Verifies EPUB loads and displays correctly
  • CBZ rendering - Verifies CBZ loads and displays correctly
  • Navigation controls - Verifies Previous/Next buttons appear correctly
  • Error states - Verifies error UI for unsupported formats

Configuration

  • maxDiffPixels: 100 - Tolerates minor anti-aliasing differences
  • threshold: 0.2 - 20% pixel difference threshold
  • Snapshots stored in e2e/snapshots/

Baseline Screenshots

Generated for Chromium. Other browsers can have baselines generated as needed.

Test plan

  • Visual regression tests pass locally (5/5)
  • Existing E2E tests still pass

- Add visual-regression.spec.ts with tests for:
  - PDF rendering
  - EPUB rendering
  - CBZ rendering
  - Navigation controls
  - Error states

- Update playwright.config.ts with snapshot settings:
  - maxDiffPixels: 100 for anti-aliasing tolerance
  - threshold: 0.2 for pixel difference threshold
  - Dedicated snapshot directory

- Generate baseline screenshots for chromium

Tests compare screenshots against baselines to detect
unintended visual changes in the reader UI.
Visual regression tests are environment-dependent and produce different
results across platforms (macOS vs Linux). This change:

- Skips visual regression tests when CI env var is set
- Uses platform-specific snapshot paths for local testing
- Increases maxDiffPixels tolerance to 500 for anti-aliasing differences
- Moves snapshots to darwin/chromium for macOS baselines

Functional E2E tests continue to run in CI.
@gvonness-apolitical gvonness-apolitical merged commit 61e0533 into main Feb 1, 2026
3 checks passed
@gvonness-apolitical gvonness-apolitical deleted the feature/visual-regression-tests branch February 1, 2026 22: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.

1 participant