test(screenshot): Roborazzi screenshot testing — Phase 1 (Status) - #6
Merged
Conversation
Introduce JVM/Robolectric screenshot testing via Roborazzi, reusing the existing Robolectric + isIncludeAndroidResources setup — no emulator. - Promote StatusContent to internal so app/src/test can render it. - Shared ScreenshotTest harness pins Locale/TimeZone and provides a real English AssetJsonLanguage (the LocalLanguage default echoes keys). - StatusScreenScreenshotTest: 5 baselines covering all four ConnectionState chips plus the redacted-recent variant. - Wire verifyRoborazziDebug into the CI quality gate; upload diff images. - Refresh the StatusContent detekt baseline ID after the internal change.
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase 1 proof-of-concept for visual regression testing: Roborazzi (JVM/Robolectric, no emulator), covering the Status screen. Reuses the existing Robolectric +
isIncludeAndroidResourcessetup, so it runs inside the currentbuild-and-testjob.Implements the strategy in
docs/screenshot-testing-strategy.md(included).Changes
StatusContentpromotedprivate→internalsoapp/src/testcan render it (the publicStatusScreen(nav)pulls in Hilt/Nav).ScreenshotTest): pinsLocale.US+Europe/Dublinand provides a real EnglishAssetJsonLanguage— the defaultLocalLanguageechoes dictionary keys, not text.StatusScreenScreenshotTest: 5 baselines — all fourConnectionStatechips (CONNECTED / CONNECTING / ERROR / DISCONNECTED) + redacted-recent.app/src/test/screenshots/(1080×2340, dark theme).verifyRoborazziDebugadded to the quality gate; diff images uploaded on failure.StatusContentdetekt baseline ID after the visibility change.Determinism
Times render from fixed
postTime+ pinned locale/timezone; app icons resolve tonullunder Robolectric → deterministic fallback (no injection needed).Verified
assembleDebug testDebugUnitTest verifyRoborazziDebug detekt lintDebugall green locally. ~14s added, no emulator.Known risk
Baselines were recorded on macOS (Intel). Linux CI may render fonts slightly differently and fail
verifyRoborazziDebugon first run. If so, the fix is to re-record baselines from CI (the Phase-2/3 "record on CI" decision) — not a code change. This PR is the deliberate test of that.Scope (intentionally deferred)
Other 6 screens, component-level tests, font-scale/locale variants, branch-protection enforcement, CI-side baseline recording — Phases 2–4.