Visual regression
Compares the current page with how it looked before. The worker takes a screenshot of the current page and compares it with frames of this same step from the latest runs — catching visual regressions.
What it catches:
- broken layout — blocks shifted, an element moved;
- missing or shifted text/element;
- broken styling — changed size, spacing, colors.
The parameter is the threshold of difference in percent of area (default 2%): a difference below it passes, above it the test fails. The comparison is pixel-based; light render noise and anti-aliasing are ignored, and the “matches at least one of the recent frames” tolerance absorbs minor dynamics.
Step outcome:
- first run or scenario changed → the baseline is rebuilt, the step passes;
- difference within the threshold → step passed;
- difference above the threshold → test fails; the frame is sent to AI vision to explain what exactly changed — the verdict appears on the run report page.
Spends AI tokens only when there is a difference (for the verdict). If tokens are low, only the pixel comparison runs, without an AI explanation.
In preview / recorder it is a stub: the comparison only runs during an actual test run.
A typical combo — capture the page state after navigation:
- Go to page — open the page
- Visual regression