- Getting Started
- Code Review
- Platforms
- CI integrations
- Web Projects
- Developer Tools
- Get Notified
- API
This guide will walk you through every step of integrating Screenshotbot into your Android projects. We provide a Gradle plugin that offers a simple solution for capturing screenshots within your Android app development workflow.
Our Gradle plugin works with the following Screenshot testing libraries:
Screenshotbot is agnostic about how you generated your screenshots. As long as you can provide us a directory of screenshots during your Continuous Integration (CI) job, you can integrate with us. This means if you're not using one of the above libraries, or you use some custom internal library, you can still integrate with Screenshotbot.
The Screenshotbot Gradle plugin automatically detects your screenshot testing library (Paparazzi, screenshot-tests-for-android, Shot) and configures itself accordingly. Here's how to integrate:
plugins { id 'io.screenshotbot.plugin' version '1.22' }Add this line to your root module's build.gradle // in sub-module file.
apply plugin: 'io.screenshotbot.plugin'Add this line to the build.gradle file of each sub-module containing screenshot tests. At this point you could test run your screenshot tests locally if you like.
./gradlew recordAndVerifyDebugScreenshotTest
./gradlew recordAndVerifyPaparazziDebugScreenshotbotCI
./gradlew recordRoborazziDebugScreenshotbotCI
./gradlew recordAndVerifyDebugAndroidScreenshotbotCI
./gradlew recordAndVerifyDebugAndroidScreenshotbotCI
./gradlew connectedDebugAndroidTestScreenshotbot -Precord=true
SCREENSHOTBOT_API_KEY=... SCREENSHOTBOT_API_SECRET=...
Screenshotbot does not require you to save any screenshots in your repository. (But it is safe if you do so.)
Your team members might still try to run the old Gradle tasks, which will generate screenshots. To avoid confusion, you might want to prevent them from commiting those screenshots into your repository. You can add those screenshots to .gitignore as follows:
**/screenshotTest/reference
**/test/snapshots
**/screenshots/debug
**/screenshots/API*/*.png
**/androidTest/screenshots
You can also use the Gradle plugin to run screenshot tests locally (i.e. not on CI).
See this page to understand how record and verify works in this flow.
For each of the libraries, we generate a record and a verify task that can be run locally.
Compose Previews | screenshotbot/compose-preview-example |
Paparazzi | screenshotbot/paparazzi-example |
Shot | screenshotbot/shot-example |
screenshot-tests-for-android | screenshotbot/screenshot-tests-for-android-example |
At this point, you will get email notifications each time your screenshots change.
To get notifications on your Pull Request, follow the integration steps corresponding to your You can then integration with your Code Review platform of you choice (for example, GitHub), to get build statuses.
Sign up or contact us.