android-testing

Configure Gradle for Android unit, integration, and screenshot tests.

1|2|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/jhparktime/OnGuard --skill android-testing-jhparktime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-testing
Source: https://github.com/jhparktime/OnGuard/tree/main/.claude/skills/android-testing
Command: npx skills add https://github.com/jhparktime/OnGuard --skill android-testing-jhparktime

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android apps increasingly rely on robust testing to ensure reliability across business logic, data layers, and user interfaces. This skill provides expert guidance on testing modern Android applications, inspired by Now in Android, covering Unit Tests, Hilt Integration Tests, and Screenshot Testing.

Core Features & Use Cases

  • Unit tests for fast feedback on ViewModels and Repositories.
  • Integration tests for Room DAOs, Retrofit interactions, and end-to-end data flows using MockWebServer.
  • UI/Screenshot tests with Roborazzi to guard visual regressions in Compose UIs.
  • Hilt testing to validate dependency injection and test graphs.
  • Practical workflows and example scenarios across typical app modules.

Quick Start

Configure your Android project with a testing pyramid and begin implementing unit, integration, and screenshot tests across your app.

Frequently Asked Questions about android-testing

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

FAQPage Schema
How do I write unit tests for Android ViewModels and Repositories?

You can write unit tests for Android ViewModels and Repositories by structuring tests to isolate business logic and data interactions. This enables fast feedback on your core app modules without requiring full device instrumentation.

What is the best way to test Room DAOs and Retrofit interactions in Android?

Integration tests using MockWebServer provide the best way to test Room DAOs and Retrofit interactions. This approach validates end-to-end data flows and database operations within modern Android modules.

How do I set up Hilt testing for dependency injection in Android?

To set up Hilt testing, configure test graphs to validate dependency injection within your Android app. This ensures your Hilt integration correctly provides dependencies across unit and integration test layers.

Can I use Roborazzi for screenshot testing Compose UIs?

You can use Roborazzi for screenshot testing Compose UIs to guard against visual regressions. It captures and verifies UI appearances, ensuring your Compose components render correctly across changes.

Do I need to configure Gradle specifically for Android integration and unit tests?

You need to configure Gradle specifically for Android integration and unit tests to specify dependencies and structure test layers. Proper Gradle setup enables isolated unit tests and end-to-end style verification.

When should I use screenshot tests over unit tests for Android Compose UI?

Use screenshot tests over unit tests when you need to guard visual regressions in Compose UIs rather than verifying isolated business logic. Unit tests provide fast feedback on ViewModels, while screenshot tests verify appearance.