Skip to content

[Tracking Issue]: Vitest → Chromatic Integration v0 #295

@AriPerkkio

Description

@AriPerkkio

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

  1. Finalized API design: Decide the supported features and shape of the API for the v0 release.
  2. 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.
  3. Changes to chromatic.com/apps web app: User can select Vitest project in the onboarding flow
  4. Support in Chromatic CLI for a --vitest flag to enable the Vitest-specific upload path.
  5. 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.
  6. Draft documentation (API + Migration Guide)
  7. Update internal documentation

Proposed higher level architecture

Image Image

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions