$ python -m regress run -c config/nirman-git.yaml --open
Did we break a page we didn't touch?
regress screenshots every page of two releases, seeded with the same data, and shows you only what really changed.
- Self-compareSame build twice, every feature0.0%
- Failed9 features, 3.7% to 12.9% of pixels9
- AddedPages new since HEAD~53
- Realigned5–7 bands per failed page, up to 8 px
Default pass threshold 0.5%
Compare against the last release
Unit and API tests don't look at the page. Instead of an assertion per screen, regress asks one question of every page: what changed since stable?
Same data on both sides
A seed file is replayed into each version through its public API, idempotently, with
post_seed_hooksfor aggregation jobs. The new write path gets tested too.No noise before the diff
Frozen clock, fixed timezone and locale, no animations, fonts loaded, masks on avatars and timestamps. Proven by comparing a build with itself.
Pages paired by what they are
pages.yamlnames features with candidate routes, so a moved route is still compared. A crawler catches pages nobody listed.A padding shift isn't a failure
The page is split into 120 px bands, each aligned within
shift_px. Movement is absorbed; a wider card or a missing column is not.
Repeatable screenshots
Every source of run-to-run noise regress removes before it diffs.
| Noise | What regress does |
|---|---|
| Relative dates | Date.now() frozen to a time that matches the seed data |
| Timezone, locale | Fixed per app profile |
| Animations, caret | Durations set to 0, reduced motion, caret hidden |
| Late data, fonts | Wait for network idle and document.fonts.ready |
| Avatars, live timestamps | masks paint them, hide removes them |
| HiDPI, scrollbars | Scale factor 1, scrollbars hidden, service workers blocked |
What you get
- Two ways to get versions: URL mode for two deployed environments, git mode to build two refs locally with the app's own
up.sh. - Perceptual colour diff with the YIQ metric pixelmatch uses, lone anti-aliasing pixels dropped, and a page that grew still fails.
- An HTML report with failed pages first, stable, new and diff side by side, and a slider to scrub between versions.
- CI-ready:
summary.jsonper page and exit code1on any failure, so a pipeline can gate a release. - Re-diff without recapturing: tune
shift_pxor thresholds against an old run in seconds. - Claude Code skills:
/generate-playwright-scriptexplores your running app through the Playwright MCP and writes its profile;/visual-regressionruns and summarises a comparison.
Set it up
The repository includes a demo on the Nirman app that builds two refs locally with Docker and the Supabase CLI.
- 1
Clone and install
A virtualenv with the Python requirements and Playwright's Chromium.
git clone https://github.com/SreekeshOkky/regress.git && cd regress python3 -m venv .venv && .venv/bin/pip install -r requirements.txt && .venv/bin/playwright install chromium - 2
Run the demo
Compares two git refs of Nirman and opens the report when it's done.
.venv/bin/python -m regress run -c config/nirman-git.yaml --open - 3
Compare two deployed environments
URL mode for real releases; credentials come from environment variables.
python -m regress run -c config/my-app-url.yaml --stable https://stable.example.com --new https://new.example.com - 4
Profile your own app
In Claude Code, against a running instance. It writes
profile.yamlandpages.yaml, then checks itself with a self-compare./generate-playwright-script
Know the limits
It answers one question very well, and only that one.
- Pixels, not DOM: it shows what changed, not why. The diff points you at the page; you read the commit.
- Chromium only. Cross-browser differences are out of scope.
- Live feeds, ads and third-party widgets must be masked, hidden or frozen.
- Git mode runs the two versions one after another: two build cycles per run.
- Not a replacement for functional tests.