android-testing

Implement Android unit, integration, UI screenshot tests with Gradle and Roborazzi.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/thinhtt264/Snaplet-App --skill android-testing-thinhtt264
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-testing
Source: https://github.com/thinhtt264/Snaplet-App/tree/main/.cursor/skills/android-testing
Command: npx skills add https://github.com/thinhtt264/Snaplet-App --skill android-testing-thinhtt264

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to testing Android applications, reducing regressions and speeding up development by covering unit, integration, and UI screenshot tests.

Core Features & Use Cases

  • Unit Testing: Verify business logic in ViewModels and Repositories with fast, deterministic tests.
  • Integration Testing: Validate interactions between components (Room DAOs, Retrofit services) and data persistence layers.
  • UI/Screenshot Testing: Ensure visual correctness for Compose-based UIs using automated screenshot validation.

Quick Start

Run your existing test suite in Android Studio or via Gradle to start validating unit, integration, and UI 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 integration tests for Android Room DAOs and Retrofit services?

To write integration tests for Android Room DAOs and Retrofit services, you validate component interactions and data persistence layers using AndroidX Test and Espresso, ensuring regressions are caught across data boundaries.

What is the best way to automate screenshot tests for Jetpack Compose UIs?

The best way to automate screenshot tests for Jetpack Compose UIs is using Roborazzi tooling, which provides automated visual validation to ensure UI correctness and catch visual regressions across different states.

Does HiltAndroidTesting work with ViewModel unit tests?

Yes, HiltAndroidTesting works with ViewModel unit tests by enabling fast, deterministic verification of business logic in ViewModels and Repositories, ensuring dependency injection behaves correctly during test execution.

How do I configure Gradle to run Android unit and UI tests in CI?

To configure Gradle to run Android tests in CI, you use standard testing libraries like JUnit4, AndroidX Test, and Roborazzi tooling within your Gradle setup, allowing local and CI execution of unit, integration, and UI tests.

What layers should a comprehensive Android testing strategy cover?

A comprehensive Android testing strategy should cover unit tests for ViewModel and Repository business logic, integration tests for Room and Retrofit interactions, and UI screenshot tests for Compose visual correctness.

Do I need Roborazzi for Android UI testing?

You need Roborazzi specifically for automated screenshot testing of Compose-based UIs to ensure visual correctness, while standard UI interactions can rely on Espresso and AndroidX Test libraries.