Thank you for your interest in contributing to Roborazzi! We welcome all contributions.
Before contributing, ensure you have:
- JDK 17 or later
- Android SDK (API level 35 for latest)
- Git
- include-build: Contains the Gradle plugin and core modules for local development
roborazzi-gradle-plugin: Gradle plugin that creates record/verify/compare tasksroborazzi-core: Core screenshot capture and comparison functionality
- Other modules:
roborazzi: Main library module for Android screenshot testing with Robolectricroborazzi-compose: Jetpack Compose support for screenshot testing of Composablesroborazzi-junit-rule: JUnit rule support for simplified test setupsample-android: Sample Android app demonstrating usage and for testing changes
Testing local changes by publishing to Maven Local can be tricky, so we recommend using the test modules within this repository to verify your changes.
These commands run screenshot tests against the sample modules. If you've made changes to the core library (e.g., in roborazzi-core, roborazzi-compose), you should verify them by modifying or adding tests within a sample-xx module (like sample-android).
# First, record baseline screenshots
./gradlew recordRoborazziDebug
# Then, verify screenshots match the baseline
./gradlew verifyRoborazziDebug
# Or, compare and generate diff images
./gradlew compareRoborazziDebugSuccess indicator: BUILD SUCCESSFUL
Tests that ensure a clean environment for testing Roborazzi's runtime APIs (like compare). They manage screenshot files (e.g., by deleting them before execution) to create a predictable state for each test run.
Located in: sample-android/src/test/java/com/github/takahirom/roborazzi/sample/boxed/
Run with:
./gradlew :sample-android:testSuccess indicator: All tests pass
Tests for the Gradle plugin functionality with real Gradle projects. If you've made changes to the Gradle plugin, you should add a new test case to the integration test suite located at include-build/roborazzi-gradle-plugin/src/integrationTest.
# Run from project root
cd include-build && ./gradlew roborazzi-gradle-plugin:integrationTest && cd ..
# Or run specific tests
cd include-build && ./gradlew roborazzi-gradle-plugin:integrationTest --tests "*RoborazziGradleProjectTest.record" && cd ..Success indicator: Integration tests pass
- Fork the repository
- Create a branch for your changes
- Make your changes
- Run relevant tests for your changes
- Commit your changes with a clear message
- Push to your fork
- Create a pull request with a description of your changes
- If tests fail, check the generated screenshots in
build/outputs/roborazzi/ - For integration test failures, check the test reports in
include-build/roborazzi-gradle-plugin/build/reports/ - Ensure you're using the correct JDK version (17+)