All your Compose @Previews to screenshot tests without instrumentation
summary
Shows how to turn Compose @Preview methods into automated screenshot tests using Paparazzi (no emulator or instrumentation) and Airbnb Showcase to generate tests, plus Google’s TestParameterInjector for dark mode/font-scale variants. Uses Gradle tasks recordPaparazzi / verifyPaparazzi and a Pixel 5 config to produce screenshots in seconds, integrates with GitHub Actions to fail PRs and post diffs, and reports a real project with ~300 screenshots taking ~12 MB stored in repo.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:06Screenshot testing benefits
- 3:39Screenshot vs UI tests
- 5:25Traditional screenshot hurdles
- 6:31Compose Previews simplify testing
- 8:22UI component showcase
- 10:57Paparazzi for fast screenshots
- 11:40Parameter Injector for variants
- 12:22Code walkthrough integration
- 13:25Running screenshot tests
- 14:32CI with GitHub Actions
- 18:28Summary
- 20:14Bonus: Image storage iOS
related talks
44mAutomating Screenshot Testing in Compose Multiplatform
40mUnderstand the mechanism! Screenshot-testing Compose previews in many variations
41mAndroid Screenshot Testing on Autopilot
42mMaking UI Specs Visible — Compose Screenshot Testing and a Gallery to Support the AI Agent Era
35mEasy screenshot testing with Compose
19mSneak Peek at the Screenshot Testing Landscape in 2024
35mBuilding a screenshot testing pipeline that scales
37mSnapshot testing (and more!) with Paparazzi
