android-screenshot-testinglisted
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android Screenshot Testing (Roborazzi)
## Overview
Screenshot tests catch visual regressions that unit tests and instrumentation tests miss — layout shifts, wrong colors, clipped text, broken dark mode. Roborazzi is preferred over Paparazzi for Compose projects because it runs on Robolectric (no JVM rendering quirks), supports Compose natively, and is actively maintained alongside the Compose ecosystem.
**When to screenshot-test vs other test types:**
| Test type | When to use |
|---|---|
| Screenshot test | Stable, rendered UI components; dark mode/RTL variants; design-system atoms; complex layouts |
| Unit test | ViewModel logic, state transformations, domain rules |
| Compose UI test (`ComposeTestRule`) | Interaction flows, click handlers, navigation |
| Manual test | First-time animations, haptics, platform-specific edge cases |
Screenshot tests are not a replacement for unit or UI tests — they are a third, complementary layer.
---
## Dependency Setup
```toml
# gradle/libs.versions.toml
[versions]
roborazzi = "1.20.0"
robolectric = "4.13"
[libraries]
roborazzi = { module = "io.github.takahirom.roborazzi:roborazzi", version.ref = "roborazzi" }
roborazzi-compose = { module = "io.github.takahirom.roborazzi:roborazzi-compose", version.ref = "roborazzi" }
roborazzi-junit-rule = { module = "io.github.takahirom.roborazzi:roborazzi-junit-rule", version.ref = "roborazzi" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
[plugins]
r