Documentation
Test Execution

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 automatically detects unintended visual changes in your application by comparing screenshots between test runs at the pixel level.

Availability: Visual regression testing is available on all plans. Enable it when running a test suite to start capturing baselines.

How It Works

1
First Run: Baseline Capture

On the first run with visual regression enabled, AegisRunner captures a screenshot at each test step. These screenshots become your baselines — the reference for how your app should look.

2
Subsequent Runs: Pixel Comparison

On every subsequent run, new screenshots are compared against baselines using pixelmatch — a pixel-level comparison algorithm. Any differences are highlighted in a diff image.

3
Review Diffs

When differences are detected, view a three-panel display: baseline (expected), current (actual), and diff (highlighted changes). The diff percentage tells you how much has changed.

4
Accept or Reject

If the visual change is intentional (e.g., a redesign), accept it as the new baseline. If it's a regression, reject it and investigate the cause.

Enabling Visual Regression

  1. Navigate to your Test Suite
  2. Click Run
  3. In the run options modal, toggle Enable Visual Regression
  4. Select your browser and click Start Run
Tip: Enable visual regression on your scheduled runs to continuously monitor for visual changes across deployments.

Viewing Visual Results

After a run completes with visual regression enabled:

  1. Open the test run from the Runs page
  2. Click on any test case to open the step details
  3. Steps with visual comparisons show a three-panel view:
PanelDescription
BaselineThe accepted reference screenshot
CurrentThe screenshot from this run
DiffHighlighted pixel differences (pink/red areas)

Diff Percentage

Each comparison shows a diff percentage badge:

  • 0% — Perfect match, no visual changes
  • 0.1% - 5% — Minor changes (font rendering, anti-aliasing)
  • >5% — Significant visual change, review required

Managing Baselines

Accepting a New Baseline

When a visual change is intentional:

  1. View the diff in the step results
  2. Click Accept as Baseline
  3. The current screenshot replaces the old baseline
  4. Future runs compare against the new baseline

Rejecting a Change

When a visual change is unintended:

  1. View the diff in the step results
  2. Click Reject
  3. The original baseline is preserved
  4. Investigate and fix the visual regression in your code

Viewing All Baselines

To see all visual baselines for a project:

  1. Go to your project settings
  2. Navigate to the Visual Baselines section
  3. View, delete, or export baselines

How Pixel Comparison Works

AegisRunner uses the pixelmatch library for comparison:

  • Screenshots are parsed as PNG images
  • Each pixel is compared with a configurable threshold
  • Anti-aliasing differences are handled gracefully
  • Dimension mismatches are automatically normalized
  • Diff images highlight changed pixels in bright pink/red

Best Practices

Visual Regression Tips:
  • Run baselines on a stable version of your app first
  • Use consistent viewport sizes for reliable comparisons
  • Accept new baselines after intentional design changes
  • Combine visual regression with functional tests for comprehensive coverage
  • Schedule visual regression runs after every deployment
  • Ignore minor anti-aliasing differences — focus on layout and content changes

Limitations

  • Dynamic content (timestamps, ads, animations) may cause false positives
  • Font rendering may differ slightly across environments
  • Screenshots are viewport-specific — changing viewport size creates new baselines

Related Documentation

Need help?

Can't find what you're looking for? Our support team is here to help.