android-testing

Combine unit, integration, and UI/screenshot tests for Android apps.

349|154|Updated Feb 18, 2021
One-click install
npx skills add https://github.com/livekit/client-sdk-android --skill android-testing-livekit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-testing
Source: https://github.com/livekit/client-sdk-android/tree/main/.agent/skills/android-testing
Command: npx skills add https://github.com/livekit/client-sdk-android --skill android-testing-livekit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to testing modern Android applications by combining unit tests, integration tests, and UI/screenshot verification to improve reliability and maintainability.

Core Features & Use Cases

  • Unit Tests: fast, isolated validation of business logic in ViewModels and Repositories.
  • Integration Tests: verify interactions between components (Room DAOs, Retrofit, networks) and data flows.
  • UI/Screenshot Testing: ensure visual correctness for Compose-based UIs using Roborazzi or similar tooling.
  • Use Case: ensure a new feature's logic passes unit tests, its data layer works with a mock or test database, and the UI renders correctly across screen sizes.

Quick Start

Set up your Android module with the recommended testing dependencies and begin by writing unit, integration, and screenshot tests.

Frequently Asked Questions about android-testing

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

FAQPage Schema
How do I test Android ViewModels and data flows effectively?

Testing Android ViewModels and data flows requires isolated unit tests using JUnit4 and kotlinx-coroutines-test. This approach validates business logic quickly by executing synchronous coroutine operations and verifying state transitions within repositories and ViewModels.

Can I use Hilt for integration testing in Android?

Yes, Hilt supports Android integration testing through the hilt-android-testing dependency. It enables automated dependency injection for your tests, allowing you to verify interactions between Room DAOs, Retrofit networks, and data flows reproducibly.

What's the best way to test Compose UI rendering across screen sizes?

Screenshot testing with Roborazzi is the best way to verify Compose UI rendering across screen sizes. It captures and compares UI images automatically, ensuring visual correctness for Compose-based interfaces during typical development and CI workflows.

Does this Android testing strategy cover both unit and integration tests?

Yes, this strategy explicitly covers unit tests for isolated ViewModel validation and integration tests for component interactions like Room and Retrofit. It combines these with UI screenshot verification to ensure comprehensive code quality and reliability.

When do I need Roborazzi for Android testing?

You need Roborazzi when performing UI and screenshot testing for modern Compose-based Android applications. It automates visual verification by rendering UI components to images, ensuring visual correctness across different screen sizes in your CI workflows.