android-test-structure

Scaffold an androidTest directory with BaseTest.kt and TestUtils.kt for Espresso tests.

3|1|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/hitoshura25/claude-devtools --skill android-test-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-test-structure
Source: https://github.com/hitoshura25/claude-devtools/tree/main/skills/android-test-structure
Command: npx skills add https://github.com/hitoshura25/claude-devtools --skill android-test-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android projects often lack a standardized, reusable test scaffolding, forcing teams to recreate boilerplate for instrumented tests.

Core Features & Use Cases

  • Automated scaffolding of androidTest directory structure under app/src/androidTest with base and utils packages.
  • Generation of a BaseTest.kt and TestUtils.kt to accelerate Espresso-based UI tests.
  • Use Case: rapidly bootstrap test infrastructure in new or existing Android projects to start writing tests immediately.

Quick Start

  • Ensure you have a Gradle-based Android project with Espresso dependencies.
  • Provide inputs: project_path (path to the Android project root) and package_name (e.g., com.example.app).
  • Run the skill to generate app/src/androidTest/kotlin/${PACKAGE_PATH}/base/BaseTest.kt and app/src/androidTest/kotlin/${PACKAGE_PATH}/utils/TestUtils.kt, plus a README at app/src/androidTest/README.md.

Frequently Asked Questions about android-test-structure

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

FAQPage Schema
How do I set up Espresso test scaffolding in an Android project?

To set up Espresso test scaffolding, you need a Gradle-based Android project and must provide the project path and package name to automatically generate the androidTest directory, BaseTest.kt, and TestUtils.kt files.

What is the standard androidTest directory structure for Espresso UI tests?

The standard androidTest directory structure for Espresso UI tests organizes files under app/src/androidTest/kotlin, separating base test classes and utility functions into dedicated base and utils packages to eliminate boilerplate.

Can I use this to bootstrap test infrastructure for an existing Android app?

Yes, you can bootstrap test infrastructure for an existing Android app. By providing the existing project path and package name, it generates the necessary BaseTest.kt and TestUtils.kt to immediately start writing instrumented tests.

Do I need Gradle and Espresso dependencies to generate a BaseTest.kt file?

Yes, you need Gradle and Espresso dependencies to generate a BaseTest.kt file. The scaffolding targets Gradle-based Android projects and creates a ready-to-run infrastructure specifically for Espresso-based instrumentation tests.

What's the best way to avoid boilerplate when writing Android instrumentation tests?

The best way to avoid boilerplate when writing Android instrumentation tests is using a scaffolding tool that generates a standardized androidTest directory with reusable BaseTest.kt and TestUtils.kt files for your project.