Visual Regression Testing
Catch unintended visual changes with pixel-level screenshot comparisons. Manage baselines, review diffs, and accept or reject changes.
Visual Regression Testing
Visual regression testing detects unintended visual changes by comparing screenshots between test runs at the pixel level using pixelmatch.
How It Works
- First run — screenshots are captured as the visual baseline for each test step
- Subsequent runs — new screenshots are compared against the baseline pixel-by-pixel
- Differences detected — pixels that differ are highlighted in the diff view
- Review — accept the new screenshot as the new baseline, or reject it as a regression
The 3-Panel Diff View
When differences are found, AegisRunner shows a 3-panel comparison:
| Panel | Shows |
|---|---|
| Baseline | The accepted reference screenshot |
| Current | The new screenshot from the latest run |
| Diff | Highlighted pixel differences (red = changed pixels) |
Accept / Reject
- Accept — the new screenshot becomes the baseline for future comparisons (intentional change)
- Reject — marks the difference as a visual regression that needs fixing
Threshold Settings
Visual comparison uses a configurable pixel difference threshold to handle minor anti-aliasing and rendering variations. By default, differences below 0.1% are ignored.
Works with Regression Manifests
Visual regression testing is most powerful when combined with regression manifests:
- Set a crawl as baseline — captures screenshots for every page state
- Run a regression crawl — replays the same pages and interactions deterministically
- Compare screenshots — pixel-level diff between baseline and current run
This ensures visual comparisons are between the same page states (same button clicked, same modal opened), not random exploration results.
Per-Step Screenshots
Visual baselines are captured at the test step level, not just per page. This means:
- A login form test has baselines for: page load, email filled, password filled, submit clicked
- Each step's screenshot is compared independently
- You can accept/reject each step's visual change separately
Related Documentation
- Regression Manifests — Deterministic crawl replay
- Test Baseline Review — Approve/reject test cases
- Running Tests — Test execution with visual comparison