All docs
Core concepts2 min readUpdated

Interaction testing

Interaction testing drives a component like a user would. UI Verify runs each Storybook story's play function, gates the build on it, then captures the snapshot.

An interaction test clicks, types, and asserts, and in Storybook that logic lives in a story's play function. For a Storybook build, UI Verify waits for the play function to pass before it captures, so the image you diff is the settled state after the interaction, not the component at first paint.

What does UI Verify do with a play function?

When a story defines a play function, UI Verify executes it and waits for it to finish before taking the screenshot. The snapshot is therefore of the interacted, settled frame - a menu opened, a form filled, a tab switched - which is the same final frame Chromatic captures for the same story (Chromatic's interaction tests docs, checked 2026-10-17, say it waits for the play function to finish before taking the snapshot). You do not author anything extra: UI Verify runs the play you already wrote for Storybook, so a component you test through interactions is screenshotted in the state those interactions leave it in. See how visual testing works.

What happens when an interaction test fails?

A play function that throws is a failed interaction test, and UI Verify treats it as distinct from a render error. That frame is never diffed and never promoted to a baseline - a story only becomes a trusted baseline once its interaction test passes - so a broken interaction cannot quietly become the reference image the next run compares against.

Does UI Verify run interaction tests without Storybook?

No. Interaction tests are the Storybook play concept, so they run on the Storybook capture path only. Playwright, Vitest, and Bun archive builds capture the state your own test drives the page or component into - there is no separate play step to run there, because your test already performed the interactions before the archive was recorded.

New to the Storybook path? The Storybook quickstart wires it up, play functions and all, in a few minutes.

Visual testing for agents

UI Verify is visual regression testing for Playwright, Storybook, Vitest and Bun. Your coding agent sees what its UI change did and fixes it before it ships. See how it works.

Get started