Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.82 KB

android-emulator-test.md

File metadata and controls

35 lines (29 loc) · 1.82 KB

(Android) Run UI / instrumentation tests on local emulator

Description

Run UI / instrumentation tests 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. The failed tests will be also available under the Test Results tab on the build details page.

bitrise.yml

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