← ClaudeAtlas

android-instrumentation-testinglisted

Instrumentation and end-to-end testing for Android - Espresso, UI Automator, Compose test rules, Hilt test injection, navigation end-to-end, IdlingResource for async ops, and running tests on Firebase Test Lab. Use this skill whenever writing tests that run on a device or emulator, testing full user flows across multiple screens, replacing Hilt modules in tests, or setting up a device test matrix in CI. Trigger on phrases like "instrumentation test", "Espresso", "UI test", "UI Automator", "end-to-end test", "HiltAndroidTest", "createAndroidComposeRule", "integration test on device", "Firebase Test Lab", or "IdlingResource".
lenorebreakneck630/claude-zero-to-hero-android-KMP · ★ 1 · Testing & QA · score 64
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android Instrumentation Testing ## Overview Instrumentation tests run on a real device or emulator inside the Android runtime. They are the only way to test: - Actual navigation transitions and back-stack behavior - System permissions dialogs (UI Automator) - Full Hilt injection graph wiring - Database + network integration without fakes - Cross-app interactions (share sheets, notifications, deep links) They are slower than unit tests. Reserve them for flows where the real runtime matters. For simple UI rendering tests, prefer Compose unit tests with `createComposeRule()` (runs on JVM — see android-testing). --- ## Dependency Setup ```toml # gradle/libs.versions.toml [versions] espresso = "3.6.1" uiautomator = "2.3.0" hilt-testing = "2.51.1" [libraries] espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" } espresso-intents = { module = "androidx.test.espresso:espresso-intents", version.ref = "espresso" } uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt-testing" } androidx-test-runner = { module = "androidx.test:runner", version = "1.6.2" } androidx-test-rules = { module = "androidx.test:rules", version = "1.6.1" } ``` ```kotlin // build.gradle.kts (module under test) android { defaultConfig { testInstrumentationRunner = "com.example.app.HiltTestRunner" } } dependencies