Writing UI Tests as Stories with Storybook Interaction Testing
Learn how to write UI tests directly inside Storybook stories using the Interaction testing feature, with a concrete button‑toggle example and steps to run the tests locally and in CI.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to write UI tests directly inside Storybook stories using the Interaction testing feature, with a concrete button‑toggle example and steps to run the tests locally and in CI.
Storybook's play functions let you attach behavior assertions directly to stories, turning your component docs into a regression suite. Here's the setup, a worked example, and the limits.
The goal is to introduce a configurable global timeout that applies to the entire play sequence in Storybook's Interaction Testing, reducing flakiness caused by unpredictable DOM update times. Currently each asynchronous action relies on the default timeout of the underlying testing‑library wrapper, and there is no built‑in mechanism to override this globall