testing-setup

Analyze and configure Android testing infrastructure for unit, UI, screenshot, and end-to-end tests.

3|Updated Aug 4, 2024
One-click install
npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill testing-setup-kabindra-shrestha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-setup
Source: https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform/tree/main/.agents/skills/testing/testing-setup
Command: npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill testing-setup-kabindra-shrestha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up a comprehensive testing strategy for Android apps requires choosing and configuring many frameworks (JUnit, Espresso, Compose Testing, Robolectric, Hilt testing, screenshot tools) and knowing where each test type belongs. This Skill analyzes an existing project's testing setup and installs, configures, and scaffolds the right testing infrastructure. ## Core Features & Use Cases - Testing Stack Analysis: Inspects build files and version catalogs to detect DI frameworks, mocking libraries, UI test frameworks, and screenshot testing tools already in use, then generates a Markdown report. - Framework Installation & Configuration: Installs JUnit4, Jacoco, Espresso or Compose Testing, Robolectric, Compose Preview Screenshot Testing, Dropshots, and UI Automator, including test runners and Hilt testing rules. - Test Harness Creation: Guides creation of unit tests, UI behavior tests, navigation tests, database tests with in-memory SQLite, screenshot tests across window sizes, and end-to-end tests. - Use Case: You inherit an Android app with zero tests. Run this Skill to audit the codebase, install a coherent testing stack, create fakes via dependency injection, and scaffold unit, UI, and screenshot tests with coverage reporting. ## Quick Start Analyze this Android project's current testing setup and install a complete testing strategy with unit, UI, and screenshot tests.

Frequently Asked Questions about testing-setup

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

FAQPage Schema
How do I set up UI tests for a Compose Android app?

Use the Compose Testing APIs with a ComposeTestRule and a ComponentActivity to access resources. Place tests in the test sourceset to run them with Robolectric, or in androidTest for instrumented runs on emulators or devices.

How do I configure Hilt for instrumented Android tests?

Add the hilt-android-testing dependency with kspAndroidTest, annotate test classes with @HiltAndroidTest, apply the HiltAndroidRule, and configure a custom AndroidJUnitRunner that uses HiltTestApplication as the test application.

Espresso vs Compose Testing: which should I use for Android UI tests?

Use Compose Testing APIs if the app is fully built with Jetpack Compose, and Espresso for View-based XML layouts. Hybrid apps can combine both, and wrappers like Kaspresso can extend Espresso for Views.

Does Compose Preview Screenshot Testing work with Kotlin Multiplatform?

No. The Compose Preview Screenshot Testing plugin and its IDE integration are engineered exclusively for Android projects and do not support non-Android targets in Kotlin Multiplatform projects.

How do I run Android UI tests without an emulator?

Use Robolectric to run Espresso or Compose UI tests on the JVM from the test sourceset. Robolectric can also power local screenshot tests through Roborazzi without needing a device.

When should I use instrumented screenshot tests instead of local ones?

Use device-based tools like Dropshots when verifying interaction with system UI, such as edge-to-edge rendering, notifications, or picture-in-picture. Local tools like Paparazzi or Compose Preview Screenshot Testing cover everything else faster.