Automating Screenshot Testing in Compose Multiplatform
summary
Shows how to turn Compose Multiplatform @Previews into automated screenshot tests using an actual repo and live demo, generating files for Android, common and desktop previews with composable preview scanner and wiring them into Roborazzi or Paparazzi. Demonstrates recording and verify tasks, animation captures at 0ms/900ms/1000ms, and failing diffs, with generated tests created quickly. Library stats: ~275 stars and ~150,000 downloads/month. Desktop needs an extra annotation workaround; Android animation timing works via the Roborazzi plugin.
AI-written summary · about
chapters (8)
- 0:00Introduction to testing
- 1:17Screenshot testing concepts
- 5:07Composable preview scanner
- 8:48Preview types in CMP
- 12:36Android demo and automation
- 23:41Desktop testing implementation
- 33:32Common module testing
- 40:21Recap and conclusion
related talks
40mUnderstand the mechanism! Screenshot-testing Compose previews in many variations
38mMastering Screenshot Testing for Android Apps
23mAll your Compose @Previews to screenshot tests without instrumentation
41mAndroid Screenshot Testing on Autopilot
35mEasy screenshot testing with Compose
19mSneak Peek at the Screenshot Testing Landscape in 2024
01h 28mMastering Screenshot Testing Libraries for Android: A Hands-On Workshop
37mSnapshot testing (and more!) with Paparazzi
