Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Let's @Preview the Future: Automating Screensho...

Let's @Preview the Future: Automating Screenshot Testing in CMP

Compose Multiplatform is gaining serious traction. With iOS support recently declared stable and Android Studio Narwhal introducing @Preview support for shared Composables in common, the ecosystem is evolving rapidly.

While @Preview is traditionally used for visual checks during UI development, what if we could transform these @Previews into powerful automated visual tests?

That's exactly what we'll explore in this talk. We'll:
- Briefly introduce screenshot testing and its key benefits
- Show how any Compose Multiplatform @Preview can become an automated screenshot test
- Walk through the full process with live coding examples

After this session, you’ll have a solid grasp of how to level up visual testing in your Compose Multiplatform projects.

Avatar for Sergio Sastre Flórez

Sergio Sastre Flórez

May 29, 2025
Tweet

More Decks by Sergio Sastre Flórez

Other Decks in Programming

Transcript

  1. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device @Previews in CMP DESKTOP @Preview
  2. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device @Previews in CMP DESKTOP @Preview
  3. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device @Previews in CMP DESKTOP @Preview
  4. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device @Previews in CMP DESKTOP @Preview
  5. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device @Previews in CMP DESKTOP @Preview
  6. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device DESKTOP @Preview Common ComposablePreviewScanner Android ComposablePreviewScanner JvmAnnotation Scanner Composable Scanner
  7. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device DESKTOP @Preview Common ComposablePreviewScanner Android ComposablePreviewScanner JvmAnnotation Scanner Composable Scanner
  8. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device DESKTOP @Preview Common ComposablePreviewScanner Android ComposablePreviewScanner JvmAnnotation Scanner Composable Scanner
  9. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device DESKTOP @Preview Common ComposablePreviewScanner Android ComposablePreviewScanner JvmAnnotation Scanner 0.7.0 Composable Scanner
  10. @Gio_Sastre ANDROID @Preview @Preview @Preview COMMON widthDp heightDp widthDp heightDp

    fontScale locale uiMode device wallpapers apiLevel @Preview systemUi showBackground backgroundColor name group name group fontScale locale device DESKTOP @Preview Common ComposablePreviewScanner Android ComposablePreviewScanner JvmAnnotation Scanner 0.8.0 0.7.0 Composable Scanner
  11. Linkedin @SergioSastre sergio-sastre @Gio_Sastre Hashnode blogs Sergio Sastre Flórez GDE

    for Android Lead Android developer Github sergio-sastre-florez