Skip to content

Run VRT from the CLI

Visual regression testing (VRT) captures screenshots of your routes and compares them against an approved baseline. The yofix vrt commands let you trigger a run, see what changed, and approve or reject the changes from your terminal. For the concept, see Visual regression.

Trigger a run

A VRT run compares a ready deployment against the baseline:

Terminal window
yofix vrt run --deployment dpl_4f2a9c

Omit --deployment to run against the most recent ready deployment for the linked project.

See what changed

List recent runs, then summarize the diffs in one:

Terminal window
yofix vrt list
yofix vrt list --status completed --branch main --limit 10
yofix vrt diff run_8a31

vrt diff prints one row per changed screenshot with its route, viewport, and diff percentage, so you can tell a real regression from noise before opening a single image.

Approve or reject

When a change is intentional, approve it to make it the new baseline:

Terminal window
yofix vrt approve run_8a31 --all # approve every pending screenshot
yofix vrt approve run_8a31 --screenshot scr_77

When a change is a regression, reject it (this does not touch the baseline):

Terminal window
yofix vrt reject run_8a31 --screenshot scr_77 --reason "Nav overlaps logo"

Re-run, cancel, and logs

Terminal window
yofix vrt rerun run_8a31 # same commit, same branches
yofix vrt cancel run_8a31 # stop a running or pending run
yofix vrt logs run_8a31 # pipeline logs for the run
yofix vrt logs run_8a31 --raw # raw log text instead of rows

Configure what gets tested

Routes and viewports define the test matrix:

Terminal window
yofix routes list
yofix routes set /pricing --threshold 0.1
yofix routes set /dashboard --auth # route requires authentication
yofix viewports list
yofix viewports set 1440x900 --name desktop
yofix viewports set 390x844 --name mobile

See Domains, environments and VRT config for the full reference.

Next