
Android Testing
- 687 installs
- 910 repo stars
- Updated July 27, 2026
- new-silvermoon/awesome-android-agent-skills
android-testing is an Android agent skill that sets up unit, Hilt integration, and Roborazzi screenshot tests for Jetpack Compose apps aligned with Now in Android patterns.
About
android-testing from new-silvermoon/awesome-android-agent-skills teaches a Now in Android–inspired testing pyramid for modern Compose apps: fast JUnit unit tests for ViewModels and repositories, Hilt integration tests for Room DAOs and Retrofit with MockWebServer, and Roborazzi screenshot tests for UI correctness. It documents required libs.versions.toml entries for JUnit, Hilt testing artifacts, and screenshot dependencies. Developers reach for it when scaffolding test coverage on a Compose codebase before release. The skill emphasizes isolating logic at the base, integration in the middle, and visual regression at the top rather than ad hoc manual QA.
- Testing pyramid: unit (ViewModels, repos), integration (Room, Retrofit/MockWebServer), UI/screenshot (Compose)
- Version-catalog snippets for JUnit4, coroutines-test, Espresso, Compose ui-test, Hilt testing, Roborazzi
- Hilt integration test patterns for DI-heavy Android modules
- Screenshot testing with Roborazzi for Compose UI regression detection
- Guidance aligned with Google Now in Android reference architecture
Android Testing by the numbers
- 687 all-time installs (skills.sh)
- +19 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #266 of 1,039 Mobile Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill android-testingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 687 |
|---|---|
| repo stars | ★ 910 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | new-silvermoon/awesome-android-agent-skills ↗ |
How do you set up Compose Android testing with Hilt?
Set up unit, Hilt integration, and Roborazzi screenshot tests for a Compose Android app aligned with Now in Android patterns.
Who is it for?
Android developers building Jetpack Compose apps who want Now in Android–style unit, Hilt, and screenshot test coverage before shipping.
Skip if: iOS or Flutter projects or legacy View-only apps without Compose should use platform-specific testing skills instead.
When should I use this skill?
A developer asks to add unit, integration, Hilt, or screenshot tests to a Jetpack Compose Android application.
What you get
JUnit unit tests, Hilt integration tests, Roborazzi screenshots, and libs.versions.toml testing dependencies for a Compose app.
- Unit test suites
- Hilt integration tests
- Roborazzi screenshot baselines
Files
Android Testing Strategies
This skill provides expert guidance on testing modern Android applications, inspired by "Now in Android". It covers Unit Tests, Hilt Integration Tests, and Screenshot Testing.
Testing Pyramid
1. Unit Tests: Fast, isolate logic (ViewModels, Repositories). 2. Integration Tests: Test interactions (Room DAOs, Retrofit vs MockWebServer). 3. UI/Screenshot Tests: Verify UI correctness (Compose).
Dependencies (libs.versions.toml)
Ensure you have the right testing dependencies.
[libraries]
junit4 = { module = "junit:junit", version = "4.13.2" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version = "1.1.5" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version = "3.5.1" }
compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4" }
hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "hilt" }
roborazzi = { group = "io.github.takahirom.roborazzi", name = "roborazzi", version.ref = "roborazzi" }Screenshot Testing with Roborazzi
Screenshot tests ensure your UI doesn't regress visually. NiA uses Roborazzi because it runs on the JVM (fast) without needing an emulator.
Setup
1. Add the plugin to libs.versions.toml:
[plugins]
roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" }2. Apply it in your module's build.gradle.kts:
plugins {
alias(libs.plugins.roborazzi)
}Writing a Screenshot Test
@RunWith(AndroidJUnit4::class)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
@Config(sdk = [33], qualifiers = RobolectricDeviceQualifiers.Pixel5)
class MyScreenScreenshotTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()
@Test
fun captureMyScreen() {
composeTestRule.setContent {
MyTheme {
MyScreen()
}
}
composeTestRule.onRoot()
.captureRoboImage()
}
}Hilt Testing
Use HiltAndroidRule to inject dependencies in tests.
@HiltAndroidTest
class MyDaoTest {
@get:Rule
var hiltRule = HiltAndroidRule(this)
@Inject
lateinit var database: MyDatabase
private lateinit var dao: MyDao
@Before
fun init() {
hiltRule.inject()
dao = database.myDao()
}
// ... tests
}Running Tests
- Unit:
./gradlew test - Screenshots:
./gradlew recordRoborazziDebug(to record) /./gradlew verifyRoborazziDebug(to verify)
Related skills
How it compares
Use android-testing for Compose + Hilt + Roborazzi setup; use generic JVM testing skills when not targeting Android mobile UI.
FAQ
What test types does android-testing cover?
android-testing covers JUnit unit tests for ViewModels and repositories, Hilt integration tests for Room and Retrofit, and Roborazzi screenshot tests for Jetpack Compose UI, following a Now in Android testing pyramid.
Does android-testing include dependency setup?
android-testing documents libs.versions.toml library entries for JUnit, Hilt test artifacts, and Roborazzi so Compose Android projects have the correct testing dependencies configured.
Is Android Testing safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.