Prompt
I'm building a frontend and need visual regression tests in CI, what should I use?
Latest observation
Oct 27, 2026
OpenAI APIWeb search: off
For visual regression testing in CI, the most common good choices are:
Best default picks
1. Playwright + screenshot assertions
Best if you already use Playwright for browser testing.
- Captures full-page or component screenshots
- Runs headless in CI
- Cross-browser support
- Easy to integrate with existing E2E tests
- Good for:
- pages
- components
- responsive layouts
- interaction states
Use this if you want a single tool for both E2E and visual checks.
2. Percy
Best if you want a polished hosted visual testing workflow.
- Designed specifically for visual regression
- Great diff review UI
- Integrates with Playwright, Cypress, Storybook, etc.
- Handles baseline management well
- Good team collaboration features
Use this if you want the least operational overhead and nice review tooling.
3. Chromatic
Best if you use Storybook.
- Automatically snapshots stories
- Very strong for component libraries
- Built for PR review of UI changes
- Excellent workflow for design system teams
Use this if your UI is Storybook-driven.
Other options
4. Cypress + image diff tooling
Works, but visual regression is usually not as smooth as Playwright/Percy/Chromatic for this use case.
5. Loki
A component visual regression tool, often used with Storybook, but less common now than Chromatic.
My recommendation
- Frontend app with E2E tests: Playwright
- Component library / Storybook: Chromatic
- Want hosted diff review across frameworks: Percy
- Want open-source and control: Playwright + pixelmatch/odiff/image snapshot tooling
Practical CI setup suggestion
If you’re starting fresh, I’d do:
- Playwright for browser automation
- Screenshot snapshots for visual regression
- Run in GitHub Actions / GitLab CI / CircleCI
- Store baselines in git or in a dedicated artifact/baseline workflow
- Use a fixed viewport, font loading strategy, and mocked network data to reduce flakiness
Important tips for stable visual tests
- Use consistent:
- viewport size
- browser/OS image
- fonts
- theme
- test data
- Disable animations/transitions
- Mock dates/time/randomness
- Avoid unstable content like ads or live timestamps
- Test key breakpoints instead of every possible size
If you want, I can recommend a specific setup based on your stack:
- React/Vue/Angular
- Storybook or not
- Playwright vs Cypress
- GitHub Actions/GitLab CI