Skip to content

Capture and update visual baselines

Visual regression compares each run’s screenshot against a saved baseline and flags meaningful changes. This guide is the hands-on workflow: capture a baseline, read the diff, and update it when you meant to change the UI. For how the comparison actually decides pass/fail (and why), see Visual regression.

Only screenshot (and takeScreenshot) steps run through the visual pipeline — other steps capture screenshots for the report, but those aren’t compared. Add a screenshot step where you want a visual check: after a page loads, or targeted at one element. See the step actions reference for the exact shape.

You don’t do anything special for the first capture.

  1. Run the test once. The first time a screenshot step runs with no baseline yet, Marriska saves what it captured as the baseline — you’ll see Baseline saved on that step.

  2. Run it again. Now there’s a baseline to compare against, so the step goes through the pixel-and-vision cascade and reports pass or fail.

Each browser stores its own baseline — Chromium, Firefox, and WebKit render real differences (especially form controls and SVG), so a Firefox run compares against the Firefox baseline, not Chromium’s.

When a visual step runs, its report row has a View Baseline toggle. Open it to see the Baseline and Current screenshots side by side, with the comparison’s verdict underneath — a one-line explanation of what changed (amber when it passed, red when it failed). Click either image to zoom.

That explanation is the point: a failed visual step tells you what looks wrong (“the primary button moved below the fold”), not just that something differs.

Update a baseline after an intentional change

Section titled “Update a baseline after an intentional change”

You redesigned the header on purpose. Now the baseline is stale and the test fails on a change you wanted. Refresh it:

  1. Open the test. Next to Run Test there’s an Update Baseline checkbox (it only appears when the test has screenshot steps).

  2. Check it and run. With the box checked, Run Test overwrites the saved baselines with the new screenshots instead of comparing against them.

  3. Uncheck it for normal runs. Leave it off and runs compare again, now against the updated baseline.

Baselines are keyed by step ID + browser, not by position. So:

  • Reordering steps or inserting new ones doesn’t invalidate a baseline — the step keeps its baseline.
  • Deleting a screenshot step deletes its baseline with it.

If a test uses sensitive variables, its screenshots never go to the external vision model — the comparison falls back to a local pixel diff so the image stays on the platform. Form fields holding secrets are also boxed out at capture.