Skip to content

Set up Roborazzi for screenshot tests#222

Closed
Goooler wants to merge 2 commits into
trunkfrom
roborazzi
Closed

Set up Roborazzi for screenshot tests#222
Goooler wants to merge 2 commits into
trunkfrom
roborazzi

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented May 11, 2026

@Goooler Goooler force-pushed the roborazzi branch 5 times, most recently from 2cae0cb to 5e9dae7 Compare May 11, 2026 15:36
@Goooler Goooler requested a review from Copilot May 11, 2026 15:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Roborazzi-based Compose screenshot testing across the UI feature modules, wiring up Robolectric test execution, a shared capture helper, and CI verification to prevent screenshot regressions.

Changes:

  • Adds a :ui:testkit module with a shared captureRoboImages helper that captures both light/dark variants.
  • Adds Robolectric screenshot tests for multiple Compose preview composables across ui/* modules (and loosens preview visibility from private to internal to make them callable from tests).
  • Integrates the Roborazzi Gradle plugin + dependencies in the root build, and adds a GitHub Actions job to run verifyRoborazziDebug.

Reviewed changes

Copilot reviewed 45 out of 96 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ui/testkit/src/main/kotlin/com/github/kr328/clash/ui/RoborazziCompose.kt Adds shared helper to capture light/dark screenshots with Roborazzi.
ui/testkit/build.gradle.kts Declares :ui:testkit as an Android library with Roborazzi deps.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/SettingsScreenTest.kt Adds screenshot test invoking the Settings preview.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/OverrideSettingsScreenTest.kt Adds screenshot test invoking the Override Settings preview.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/NetworkSettingsScreenTest.kt Adds screenshot tests for Network Settings previews.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/MetaFeatureSettingsScreenTest.kt Adds screenshot test for Meta Feature Settings preview.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/EditableTextMapScreenTest.kt Adds screenshot test for EditableTextMap preview.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/EditableTextListScreenTest.kt Adds screenshot test for EditableTextList preview.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/AppSettingsScreenTest.kt Adds screenshot tests for App Settings previews.
ui/settings/src/test/kotlin/com/github/kr328/clash/settings/ui/AccessControlScreenTest.kt Adds screenshot tests for Access Control previews/sheets.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/SettingsScreen.kt Makes preview composable internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/OverrideSettingsScreen.kt Makes preview composable internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/NetworkSettingsScreen.kt Makes preview composables internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/MetaFeatureSettingsScreen.kt Makes preview composable internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/EditableTextMapScreen.kt Makes preview composable internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/EditableTextListScreen.kt Makes preview composable internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/AppSettingsScreen.kt Makes preview composables internal for test access.
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/AccessControlScreen.kt Makes preview composables internal for test access.
ui/proxy/src/test/kotlin/com/github/kr328/clash/proxy/ui/ProxyScreenTest.kt Adds screenshot test invoking the Proxy preview.
ui/proxy/src/main/kotlin/com/github/kr328/clash/proxy/ui/ProxyScreen.kt Makes preview composable internal for test access.
ui/profile/src/test/kotlin/com/github/kr328/clash/profile/ui/ProvidersScreenTest.kt Adds screenshot test invoking the Providers preview.
ui/profile/src/test/kotlin/com/github/kr328/clash/profile/ui/PropertiesScreenTest.kt Adds screenshot test invoking the Properties preview.
ui/profile/src/test/kotlin/com/github/kr328/clash/profile/ui/ProfilesScreenTest.kt Adds screenshot test invoking the Profiles preview.
ui/profile/src/test/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreenTest.kt Adds screenshot test invoking the New Profile preview.
ui/profile/src/test/kotlin/com/github/kr328/clash/profile/ui/FilesScreenTest.kt Adds screenshot test invoking the Files preview.
ui/profile/src/main/kotlin/com/github/kr328/clash/profile/ui/ProvidersScreen.kt Makes preview composable internal for test access.
ui/profile/src/main/kotlin/com/github/kr328/clash/profile/ui/PropertiesScreen.kt Makes preview composable internal for test access.
ui/profile/src/main/kotlin/com/github/kr328/clash/profile/ui/ProfilesScreen.kt Makes preview composable internal and stabilizes preview time data.
ui/profile/src/main/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreen.kt Makes preview composable internal for test access.
ui/profile/src/main/kotlin/com/github/kr328/clash/profile/ui/FilesScreen.kt Makes preview composable internal for test access.
ui/log/src/test/kotlin/com/github/kr328/clash/log/ui/LogsScreenTest.kt Adds screenshot test invoking the Logs preview.
ui/log/src/test/kotlin/com/github/kr328/clash/log/ui/LogcatScreenTest.kt Adds screenshot test invoking the Logcat preview.
ui/log/src/main/kotlin/com/github/kr328/clash/log/ui/LogsScreen.kt Makes preview composable internal for test access.
ui/log/src/main/kotlin/com/github/kr328/clash/log/ui/LogcatScreen.kt Makes preview composable internal for test access.
ui/home/src/test/kotlin/com/github/kr328/clash/home/ui/HomeScreenTest.kt Adds screenshot tests invoking Home previews.
ui/home/src/test/kotlin/com/github/kr328/clash/home/ui/HelpScreenTest.kt Adds screenshot test invoking Help preview.
ui/home/src/main/kotlin/com/github/kr328/clash/home/ui/HomeScreen.kt Makes preview composables internal for test access.
ui/home/src/main/kotlin/com/github/kr328/clash/home/ui/HelpScreen.kt Makes preview composable internal for test access.
ui/crash/src/test/kotlin/com/github/kr328/clash/crash/ui/AppCrashedScreenTest.kt Adds screenshot test invoking crash preview.
ui/crash/src/test/kotlin/com/github/kr328/clash/crash/ui/ApkBrokenScreenTest.kt Adds screenshot test invoking apk-broken preview.
ui/crash/src/main/kotlin/com/github/kr328/clash/crash/ui/AppCrashedScreen.kt Makes preview composable internal for test access.
ui/crash/src/main/kotlin/com/github/kr328/clash/crash/ui/ApkBrokenScreen.kt Makes preview composable internal for test access.
settings.gradle.kts Includes the new :ui:testkit module.
gradle/libs.versions.toml Adds Roborazzi + test libraries and plugin coordinates.
build.gradle.kts Enables Robolectric resources, applies/configures Roborazzi, and adds test deps to Compose modules.
.github/workflows/build.yml Adds CI job running verifyRoborazziDebug and makes it required.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
@Goooler
Copy link
Copy Markdown
Owner Author

Goooler commented May 12, 2026

Blocker: takahirom/roborazzi#828

@Goooler Goooler closed this May 12, 2026
@Goooler Goooler deleted the roborazzi branch May 12, 2026 07:18
@Goooler Goooler restored the roborazzi branch May 21, 2026 19:51
@Goooler Goooler reopened this May 21, 2026
Goooler and others added 2 commits May 21, 2026 21:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Goooler Goooler closed this May 21, 2026
@Goooler Goooler deleted the roborazzi branch May 21, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants