Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.74 KB

android-emulator-test.md

File metadata and controls

35 lines (29 loc) · 1.74 KB

(Android) Run tests using the emulator

Description

Run any kind of tests (unit, instrumentation) on a local emulator instance.

Instructions

  1. Add an AVD Manager Step. To customize the emulator, see the step configuration.
  2. Add a Wait for Android emulator step.
  3. Add a Gradle Runner step. Set the input variables:
    • gradlew file path: for example, ./gradlew.
    • Gradle task to run: for example, connectedDebugAndroidTest.
  4. Add a Export test results to Test Reports add-on Step with the following inputs:
    • The name of the test: Emulator tests.
    • Test result base path: $BITRISE_SOURCE_DIR/app/build/outputs/androidTest-results. You might want to adjust the path based on the module name(s) in your project.
    • Test result search pattern: *.xml.
  5. Add a Deploy to Bitrise.io - Apps, Logs, Artifacts Step that makes the test results available in the Test Reports add-on.

bitrise.yml

- avd-manager@1: {}
- wait-for-android-emulator@1:
- gradle-runner@2:
    inputs:
    - gradlew_path: ./gradlew
    - gradle_task: connectedDebugAndroidTest
- custom-test-results-export@0:
    inputs:
    - search_pattern: "*.xml"
    - base_path: $BITRISE_SOURCE_DIR/app/build/outputs/androidTest-results
    - test_name: Emulator tests
- deploy-to-bitrise-io@2: