Build setup
Roborazzi is available on maven central.
This plugin simply creates Gradle tasks record, verify, compare and passes the configuration to the test.
build.gradle.kts
plugins | buildscript |
---|---|
Define plugin in root build.gradle.kts
plugins {
...
id("io.github.takahirom.roborazzi") version "[version]" apply false
}
Apply plugin in module build.gradle.kts
plugins {
...
id("io.github.takahirom.roborazzi")
}
| root build.gradle.kts
buildscript {
dependencies {
...
classpath("io.github.takahirom.roborazzi:roborazzi-gradle-plugin:[version]")
}
}
module build.gradle.kts
plugins {
...
id("io.github.takahirom.roborazzi")
}
|
Use Roborazzi task | Use default unit test task | Description |
---|---|---|
|
or
| Record a screenshot |
|
or
| Review changes made to an image. This action will compare the current image with the saved one, generating a comparison image labeled as |
|
or
| Validate changes made to an image. If there is any difference between the current image and the saved one, the test will fail. |
|
or
| This task will first verify the images and, if differences are detected, it will record a new baseline. |
| This is not a test task. | Note: This is an experimental task. This task will clear the saved images. This task also deletes the cached images. Please be careful when using this task. |
The comparison image, saved as [original]_compare.png
, is shown below:
You can check the test report in build/reports/roborazzi/index.html
This uses JetNew from Compose Samples. You can check the pull request introducing Roborazzi to the compose-samples here.
Add dependencies
Description | Dependencies |
---|---|
Core functions |
|
Jetpack Compose |
|
JUnit rules |
|