Loading...
Loading...
Android testing with Espresso, UIAutomator, and Compose Testing; layered strategy, flake control, device matrix, CI integration, and ADB automation.
npx skill4agent add vasilyu1983/ai-agents-public qa-testing-android| Task | Command |
|---|---|
| List emulators | |
| Start emulator | |
| List devices | |
| Install APK | |
| Run unit tests | |
| Run instrumented tests (connected) | |
| Run instrumented tests (GMD) | |
| List GMD tasks | `./gradlew tasks --all |
| Clear app data | |
connectedAndroidTesttestOptionswithId()testTagandroid {
testOptions {
animationsDisabled = true
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
}
dependencies {
androidTestUtil(libs.androidx.test.orchestrator)
}| Layer | Framework | Scope |
|---|---|---|
| Unit | JUnit + Mockito | JVM, no Android |
| Unit (Android) | Robolectric | JVM, simulated |
| UI (Views) | Espresso | Instrumented |
| UI (Compose) | Compose Testing | Instrumented |
| System | UIAutomator | Cross-app |
testOptions { animationsDisabled = true }waitUntilMockWebServerreferences/espresso-patterns.mdreferences/compose-testing.mdreferences/uiautomator.mdidModifier.testTagresource-idcontent-descwaitUntil./gradlew connectedAndroidTestreferences/gradle-managed-devices.md**/build/reports/androidTests/# Screenshot
adb exec-out screencap -p > screenshot.png
# Screen recording
adb shell screenrecord /sdcard/demo.mp4references/gradle-managed-devices.md# .github/workflows/android.yml
name: Android CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew test pixel6api34DebugAndroidTestrg -n \"^## \" frameworks/shared-skills/skills/qa-testing-android/references/compose-testing.mdrg -n \"Idling|waitUntil|Synchronization\" frameworks/shared-skills/skills/qa-testing-android/references/compose-testing.mdrg -n \"RecyclerView|Intents\" frameworks/shared-skills/skills/qa-testing-android/references/espresso-patterns.mdwaitUntilThread.sleep()| Resource | Purpose |
|---|---|
| references/espresso-patterns.md | Espresso matchers, actions |
| references/compose-testing.md | Compose testing guide |
| references/uiautomator.md | UIAutomator patterns (system UI) |
| references/gradle-managed-devices.md | Managed Devices for CI |
| data/sources.json | Documentation links |
| Template | Purpose |
|---|---|
| assets/template-android-test-checklist.md | Stability checklist |
| Skill | Purpose |
|---|---|
| software-mobile | Android development |
| qa-testing-strategy | Test strategy |
| qa-testing-mobile | Cross-platform mobile |