© Mapbox, © OpenStreetMap

Speaker

Cagdas Caglak

Cagdas Caglak

Lead Software Engineer at JPMorgan Chase & Co.

London, United Kingdom

Actions

Hi, I’m Cagdas. I’ve been building Android apps for over 9 years, and today I work as a Lead Software Engineer at JPMorgan Chase & Co. My focus is on scalable app design and bringing ideas to life with Kotlin and Jetpack Compose.

Area of Expertise

  • Information & Communications Technology

Topics

  • Kotlin
  • Kotlin Multiplatform
  • Android
  • Testing
  • Automation

Android Screenshot Testing on Autopilot

Screenshot testing is an essential but often tedious process in Android development. Traditional
approaches require developers to manually write and maintain screenshot tests, increasing development
time and maintenance overhead.

In this talk, I will demonstrate how to automate screenshot testing using Jetpack Compose previews by
leveraging Kotlin Symbol Processing (KSP), Paparazzi, and a custom Gradle plugin. This approach allows
developers to generate screenshot tests dynamically at compile time without modifying their existing
code. Additionally, I will explain how the Gradle plugin ensures the correct configuration before KSP
execution, enabling a seamless integration into any project.

One of the key challenges I tackled was managing source sets—since @Preview functions reside in the
main source set, the generated tests must also be part of it. I will explain how I solved this by defining a
new test source set within the main source set, allowing the generated tests to execute properly.

Furthermore, I will discuss how this method can be extended beyond @Preview annotations using
custom annotations and how unit testing KSP can help reduce maintenance overhead, given that the
generated code structure remains stable.

This session is ideal for Android developers looking to streamline their UI testing process, reduce
maintenance effort, and ensure consistent screenshot outputs with Compose previews.

Key Takeaways:
1. Automate screenshot tests using Jetpack Compose previews without modifying existing code.
2. Leverage KSP and a Gradle plugin to dynamically generate and execute tests at compile time.
3. Manage source set challenges by defining a test source set within the main source set.
4. Discuss how unit testing KSP can minimize maintenance costs due to its stable generated code
structure.
5. Extend the approach beyond @Preview with custom annotations.

Keywords:
Jetpack Compose, Kotlin Symbol Processing (KSP), Screenshot Testing, Paparazzi, UI Testing, Gradle Plugin,
Automation, Preview Annotation

droidcon London 2025 Sessionize Event

October 2025 London, United Kingdom

Cagdas Caglak

Lead Software Engineer at JPMorgan Chase & Co.

London, United Kingdom

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top