Component Testing That Scales: How to Power Up Cypress With Storybook
summary
Claims that combining Cypress component testing with Storybook turns documentation into executable fixtures, reusing stories instead of duplicating fixtures and eliminating iframe/server overhead. Demo shows a flight‑search app (React + TypeScript + Vite + Tailwind) using Storybook 9, Cypress 13 and Mock Service Worker to test search form and flight card variants; tests mount composed stories and run in a real browser with network stubbing and HMR, all passing in the demo. Key points: composeStories imports stories as modules, mounts in real browser with Cypress 13, reuses Storybook decorators and args.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:24Why component testing
- 3:12Cypress component testing
- 4:35Storybook overview
- 5:39Combining Cypress and Storybook
- 8:28When Cypress shines
- 10:35Storybook vs Cypress
- 12:43Compost stories explained
- 14:05Setting up Cypress
- 15:55Scaling the setup
- 17:20Mocking strategies
- 18:25Consistency across tests
- 20:10Cypress Cloud benefits
- 23:43Demo project overview
- 25:29Running the application
- 29:04Storybook stories
- 31:11Cypress component testing
- 34:23Running component tests
- 37:15End-to-end testing
- 41:14Demo recap
- 42:00Q&A
