Visual Diff Viewer
Inspect visual regression failures with four interactive view modes: Slider, 2-Up, Diff Overlay, and Onion Skin.
A specialized component for inspecting visual regression test failures. When a test includes visual comparison artifacts (snapshots comparing expected vs actual screen captures), Zen Reports for Playwright embeds the Visual Diff Viewer inside the test case detail.

Overview
The viewer displays the comparison target name and provides an interactive inspection canvas with four view modes to pinpoint pixel shifts and rendering regressions.

View Modes
Switch between view modes using the toolbar selector or keyboard shortcuts:
| Mode | Key | Behavior |
|---|---|---|
| Slider | 1 |
An interactive before/after split slider allowing you to drag the divider horizontally to reveal expected vs actual images. |
| 2-Up (Side by Side) | 2 |
Displays the expected baseline image and actual test snapshot side by side with synchronized dimensions. |
| Diff Overlay | 3 |
Highlights mismatching pixels. If Playwright generated an image diff artifact (diffUrl), it renders the diff; otherwise, it applies CSS difference blend modes. |
| Onion Skin | 4 |
Overlays actual and expected images with an adjustable transparency opacity slider to spot subtle layout shifts. |



Controls & Keyboard Shortcuts
1– Switch to Slider mode.2– Switch to 2-Up (Side by Side) mode.3– Switch to Diff Overlay mode (available when diff image or CSS blend mode is applicable).4– Switch to Onion Skin mode.Esc– Close the visual diff viewer modal.
Related
- Opening visual regression comparisons from test cases: see the Suites tab.
- Inspecting other test artifacts (logs, videos, screenshots): see Attachments & Preview.