test(android): screenshot tests for every screen

Roborazzi draws Library (phone, tablet, font scale 1.5, empty), a title,
Shares, Settings and Downloads from fixed records under Robolectric, and
build-android.sh check compares them with the committed images in
app/src/test/screenshots. The redesign changes every screen; a layout
regression now fails the gate and shows up in review as a changed image.
This commit is contained in:
nvrl committed 2026-10-03 04:34:46 +02:00
1 parent f2e69dc852
commit c63f08ac91
14 files changed
+216 -5

No files matched your search

+13
View File
@@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ktlint)
alias(libs.plugins.roborazzi)
}
val repositoryRoot = rootProject.projectDir.parentFile
@@ -272,6 +273,11 @@ dependencies {
testImplementation(libs.robolectric)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.work.testing)
testImplementation(platform(libs.androidx.compose.bom))
testImplementation(libs.androidx.compose.ui.test.junit4)
testImplementation(libs.roborazzi)
testImplementation(libs.roborazzi.compose)
testImplementation(libs.roborazzi.junit.rule)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.test.core)
@@ -295,6 +301,13 @@ ktlint {
}
}
// Screenshot baselines live beside the tests that draw them, so a change to how
// a screen looks shows up in review as a changed image. `recordRoborazziDebug`
// rewrites them; `verifyRoborazziDebug` fails on any difference.
roborazzi {
outputDir.set(file("src/test/screenshots"))
}
// The generated UniFFI directory is a main source dir, so ktlint reads it even
// though the filter above drops every file in it. Without this, Gradle refuses
// the build for an undeclared dependency between the two tasks.