This project integrates Vitest Browser Mode with Chromatic's visual regression testing platform. Users can capture and compare visual snapshots of their UI components directly from Vitest tests. Screenshots are compared on Chromatic's infrastructure rather than locally, eliminating the flakiness caused by differences in OS, fonts, and rendering engines.
Technical Deliverables
- Finalized API design: Decide the supported features and shape of the API for the v0 release.
- New
@chromatic-com/vitest package in the chromatic-e2e monorepo, enabling users to take snapshots within existing Vitest component test suites and upload results to Chromatic.
- Changes to
chromatic.com/apps web app: User can select Vitest project in the onboarding flow
- Support in Chromatic CLI for a
--vitest flag to enable the Vitest-specific upload path.
- QA against real-world Vitest projects. Validate that the API holds up against realistic project structures, including workspaces, mixed test suites (unit + component test), and existing fixture setups.
- Draft documentation (API + Migration Guide)
- Update internal documentation
Proposed higher level architecture
Project Tracking
✅ Milestone 1: Define Test APIs
Completed
✅ Milestone 2: Minimal implementation for generating DOM snapshot and archives on file system on test run
Completed
✅ Milestone 3: Expose takeSnapshot() as public API
- Owner: @AriPerkkio
- Completed By: 7th April
- Finalize
takeSnapshot() API and expose it as part of public API
Completed
✅ Milestone 4: Network idle detection
- Owner: @AriPerkkio
- Completed By: 9th April
- Implement smart network traffic detector that can be used before writing archives. Before this we’ve used just setTimeout + await.
Completed
✅ Milestone 5: Controlling Automatic Snapshots
- Owner: @AriPerkkio
- Completed By: 13th April
- Expose
disableAutoSnapshot: boolean plugin option and disableAutoSnapshot() function to user.
Completed
✅ Milestone 6: Limiting tests using tags
- Owner: @AriPerkkio
- Completed By: 15th April
- Expose
tags: string[] plugin option and implement test filtering based on tags.
Completed
✅ Milestone 7: Chromatic CLI can upload Vitest projects
- Owner: @AriPerkkio
- Completed By: 22nd April
chromatic-cli can do chromatic --vitest.
Completed:
✅ Milestone 8: Web app changes
- Owner: @treeforever
- Completed By: April 10th
- User can select Vitest as project type when creating new project on web app
✅ Milestone 9: Draft documentation
- Owner: @AriPerkkio
- Compelted By: 27th April
- Initial version of the API documentation. No need to be publish-ready.
Completed:
PRs below are finished from my end and handed to @winkerVSbecks for final changes:
✅ Milestone 10: Internal documentation updates
- Owner: @AriPerkkio
- Completed By: 4th May
- Write down architechture and implementation solution.
Completed
- Updated
System Documentation / Explanations / E2E Visual Tests Notion docs
✅ Milestone 11: @chromatic-com/* packages to support Storybook 10
Completed
Other issues
This project integrates Vitest Browser Mode with Chromatic's visual regression testing platform. Users can capture and compare visual snapshots of their UI components directly from Vitest tests. Screenshots are compared on Chromatic's infrastructure rather than locally, eliminating the flakiness caused by differences in OS, fonts, and rendering engines.
Technical Deliverables
@chromatic-com/vitestpackage in the chromatic-e2e monorepo, enabling users to take snapshots within existing Vitest component test suites and upload results to Chromatic.chromatic.com/appsweb app: User can select Vitest project in the onboarding flow--vitestflag to enable the Vitest-specific upload path.Proposed higher level architecture
Project Tracking
✅ Milestone 1: Define Test APIs
Completed
✅ Milestone 2: Minimal implementation for generating DOM snapshot and archives on file system on test run
Completed
@chromatic-com/vitest, minimal setup #296✅ Milestone 3: Expose
takeSnapshot()as public APItakeSnapshot()API and expose it as part of public APICompleted
takeSnapshot()as public API #300✅ Milestone 4: Network idle detection
Completed
waitForIdleNetworkAPI #301✅ Milestone 5: Controlling Automatic Snapshots
disableAutoSnapshot: booleanplugin option anddisableAutoSnapshot()function to user.Completed
disableAutoSnapshot: booleanplugin option anddisableAutoSnapshot()API #302✅ Milestone 6: Limiting tests using tags
tags: string[]plugin option and implement test filtering based on tags.Completed
tagsplugin option #303✅ Milestone 7: Chromatic CLI can upload Vitest projects
chromatic-clican dochromatic --vitest.Completed:
--vitestflag for@chromatic-com/vitestintegration chromatic-cli#1252✅ Milestone 8: Web app changes
✅ Milestone 9: Draft documentation
Completed:
PRs below are finished from my end and handed to @winkerVSbecks for final changes:
VitestIconand Vitest into Header tetra#147✅ Milestone 10: Internal documentation updates
Completed
System Documentation / Explanations / E2E Visual TestsNotion docs✅ Milestone 11:
@chromatic-com/*packages to support Storybook 10storybook@8.5.xto latest. Ideally fix versioning for long term using plans described in https://www.notion.so/chromatic-ui/E2E-with-Storybook-Versioning-Ideas-2066e81620348009b732fcedabefa7c7.Completed
Other issues
vitest --merge-reportsis used #311