android-testing-setup

Analyze and configure unit, UI, screenshot, and end-to-end test infrastructure for native Android apps.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/Zeyad-37/tech-agency --skill android-testing-setup-zeyad-37
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: android-testing-setup
Source: https://github.com/Zeyad-37/tech-agency/tree/main/.claude/skills/android-testing-setup
Command: npx skills add https://github.com/Zeyad-37/tech-agency --skill android-testing-setup-zeyad-37

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up a complete Android testing strategy requires choosing and wiring many frameworks (JUnit, Robolectric, Espresso, Compose Test, Hilt testing, screenshot tools, JaCoCo), which is error-prone and time-consuming when done manually. ## Core Features & Use Cases - Testing Stack Analysis: Inspects libs.versions.toml and build files to detect existing DI, mocking, UI testing, and screenshot frameworks, then generates a Markdown report. - Framework Installation & Configuration: Installs JUnit4, JaCoCo, Robolectric, Compose Preview Screenshot Testing, Dropshots, UI Automator, and configures Hilt test runners and rules. - Test Authoring Guidance: Creates unit tests for ViewModels and repositories, Compose/Espresso behavior tests, navigation tests, database tests with in-memory SQLite, and screen-level screenshot tests across sizes and themes. - Use Case: Point the Skill at an Android project with no tests and receive a configured testing infrastructure plus a documented testing strategy in docs/testing.md or AGENTS.md. ## Quick Start Analyze this Android project's testing setup and install a complete unit, UI, and screenshot testing infrastructure.

Frequently Asked Questions about android-testing-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up screenshot testing for Jetpack Compose?▼

Enable the android.experimental.enableScreenshotTest property, apply the com.android.compose.screenshot plugin, and mark previews with @PreviewTest in the screenshotTest source set. Generate reference images with the updateDebugScreenshotTest Gradle task and validate with validateDebugScreenshotTest.

How do I configure Hilt for instrumented Android tests?▼

Add hilt-android-testing to androidTestImplementation, annotate test classes with @HiltAndroidTest, and apply HiltAndroidRule. Create a custom AndroidJUnitRunner that returns HiltTestApplication and set it as testInstrumentationRunner in your build file.

Should I use Robolectric or instrumented tests for Android UI testing?▼

Robolectric runs Compose and Espresso UI tests locally in the test source set without a device, making them faster. Use instrumented androidTest tests when you need real device behavior, system UI interaction, or on-device SQLite verification.

Does Compose Preview Screenshot Testing work with Kotlin Multiplatform?▼

No, the Compose Preview Screenshot Testing plugin and IDE integration are engineered exclusively for Android projects and do not support non-Android targets in KMP projects. KMP projects should consider alternatives like Paparazzi or Roborazzi.

When should I use Dropshots versus Roborazzi for screenshot tests?▼

Dropshots runs instrumented screenshot tests on a device, needed when verifying system UI interaction like edge-to-edge rendering or notifications. Roborazzi runs on Robolectric locally, making it suitable for fast host-side screen verification.