android-espresso-dependencies

Add Espresso and AndroidX Test dependencies to Android project

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "android-espresso-dependencies" with this command: npx skills add hitoshura25/claude-devtools/hitoshura25-claude-devtools-android-espresso-dependencies

Android Espresso Dependencies

Adds Espresso and AndroidX Test dependencies required for E2E UI testing.

Prerequisites

  • Android project with Gradle
  • Kotlin DSL (build.gradle.kts)
  • Minimum SDK 21+ (Espresso requirement)

Inputs

InputRequiredDefaultDescription
project_pathYes.Android project root

Process

Step 1: Add Espresso Dependencies

Add to app/build.gradle.kts:

dependencies {
    // Existing dependencies...

    // Espresso core
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    androidTestImplementation("androidx.test.espresso:espresso-contrib:3.5.1")
    androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1")

    // AndroidX Test
    androidTestImplementation("androidx.test:runner:1.5.2")
    androidTestImplementation("androidx.test:rules:1.5.0")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.ext:junit-ktx:1.1.5")
}

Detection logic:

  • Check if dependencies already exist (don't duplicate)
  • Use latest stable versions
  • Keep existing test dependencies

Step 2: Configure Test Runner (Optional)

If user wants test orchestrator for better isolation:

android {
    // ... existing config ...

    defaultConfig {
        // ... existing config ...
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    testOptions {
        execution = "ANDROIDX_TEST_ORCHESTRATOR"
        animationsDisabled = true
    }
}

dependencies {
    // ... existing dependencies ...
    androidTestUtil("androidx.test:orchestrator:1.4.2")
}

Ask user: "Enable test orchestrator for better test isolation? (Recommended for large test suites)"

Verification

MANDATORY: Run these commands:

# Sync Gradle
./gradlew dependencies --configuration androidTestRuntimeClasspath

# Verify Espresso dependencies
./gradlew dependencies | grep espresso && echo "✓ Espresso dependencies added"

# Verify AndroidX Test dependencies
./gradlew dependencies | grep "androidx.test" && echo "✓ AndroidX Test dependencies added"

Expected output:

  • ✓ Espresso dependencies added
  • ✓ AndroidX Test dependencies added

Outputs

OutputLocationDescription
Dependenciesapp/build.gradle.ktsEspresso and AndroidX Test libs

Troubleshooting

"Dependency resolution failed"

Cause: Version conflict with existing dependencies Fix: Check for conflicting androidx.test versions, align all to same version

"Minimum SDK too low"

Cause: minSdk < 21 Fix: Espresso requires API 21+, update minSdk in defaultConfig

Completion Criteria

  • Espresso dependencies in app/build.gradle.kts
  • AndroidX Test dependencies in app/build.gradle.kts
  • Test runner configured
  • ./gradlew dependencies shows espresso libraries

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

android-playstore-setup

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

android-playstore-scan

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

android-proguard-setup

No summary provided by upstream source.

Repository SourceNeeds Review