$ show takahirom/roborazzi
Roborazzi is a Kotlin-based visual regression testing framework for Android, Compose Multiplatform (Desktop, iOS), and pure JVM. It integrates with Robolectric to capture screenshots of UI components in unit tests, compares them against golden images, and generates detailed reports (HTML, JSON, PR comments). The framework includes a Gradle plugin that creates record/verify/compare tasks, a JUnit rule for automatic capture, support for GIF/APNG/video recording, UI tree dumps, accessibility checks (via ATF), and experimental AI-powered image assertions (Gemini, OpenAI). It also auto-generates screenshot tests from Compose `@Preview` annotations for both Robolectric and Desktop targets. The architecture is modular: a core library with platform-specific implementations for Android, Desktop, and iOS; a painter module for image encoding/decoding; and separate modules for Compose integration, JUnit rules, preview scanning, and an IntelliJ/Android Studio plugin. The codebase is actively maintained, well-documented, and employs modern Kotlin patterns (KMP, Gradle Configuration Cache, BuildService). It is not a data research project.
The LLM identified 3 files worth highlighting for reuse:
A self-contained APNG encoder that writes PNG chunks manually to create lossless animated images from a sequence of frames. It supports configurable frame delays (1-65535 ms), custom background colors, and multiple passes. The encoder is thread-safe, uses only standard Java I/O and image libraries, and can be extracted as a standalone utility for any JVM project that needs APNG output without external dependencies.
Implements multiple configurable strategies for generating golden file paths from test metadata: testPackageAndClassAndMethod, testNestedPackageDirAndClassAndMethod, and testPackageAndClassAndMethodWithVirtualDir. Each strategy produces deterministic, human-readable paths that mirror test class structures. The module is self-contained, depends only on standard library types, and can be reused in any testing framework that needs consistent path generation from test method and class names.
Bundles HTML report assets (Materialize CSS, Material Icons) as byte arrays compiled into the Jar, then writes them to disk at runtime via a clean streaming API. This pattern allows the Gradle plugin to serve a standalone HTML report without external network dependencies. The code is compact, self-contained, and demonstrates a reusable pattern for embedding and extracting web resources in JVM libraries.