How to run Detox tests using an Android emulator

I’m trying to run Detox tests on Bitrise using an android emulator but I’ve been facing some issues. It seems like there’s an issue between the emulator running on Bitrise and the Detox server.

This is my bitrise.yml that you can use to reproduce this issue

format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: "*"
  workflow: tests
workflows:
  _project_setup:
    steps:
    - activate-ssh-key: {}
    - git-clone:
        inputs:
        - clone_depth: ''
        title: Git Clone Repo
    - cache-pull@2.0.1:
        inputs:
        - is_debug_mode: 'true'
    - script:
        inputs:
        - content: |-
            #!/bin/bash

            yarn
        title: Install Yarn Packages
    before_run: 
    after_run: 
  _detox_setup:
    before_run: []
    after_run: []
    steps:
    - yarn:
        inputs:
        - command: global add detox-cli
        title: Install Detox CLI
    - yarn:
        inputs:
        - command: global add react-native-cli
        title: Install React Native CLI
    - script:
        inputs:
        - content: |-
            #!/bin/bash

            brew tap facebook/fb
            export CODE_SIGNING_REQUIRED=NO
            brew install fbsimctl

            brew tap wix/brew
            brew install applesimutils --HEAD
        title: Install Detox Utils
  _detox_android:
    steps:
    - install-missing-android-tools@2.3.2:
        inputs:
        - gradlew_path: "$PROJECT_LOCATION/gradlew"
    - create-android-emulator@1.1.6:
        inputs:
        - custom_hardware_profile_content: |-
            image.sysdir.1=system-images/android-19/default/armeabi-v7a/
            avd.ini.encoding=UTF-8
            abi.type=armeabi-v7a
            hw.cpu.arch=arm
            hw.cpu.model=cortex-a8
            hw.lcd.density=240
            hw.lcd.height=1920
            hw.lcd.width=1080
            hw.ramSize=512
            tag.display=Default
            tag.id=default
            disk.dataPartition.size=1024M
            hw.camera.back=emulated
            hw.camera.front=emulated
            hw.keyboard=yes
            hw.gpu.enabled=true
            hw.gpu.mode=swiftshader
            hw.ramSize=1536
            runtime.network.latency=none
            runtime.network.speed=full
            showDeviceFrame=no
            skin.dynamic=yes
            skin.path=_no_skin
            skin.path.backup=_no_skin
            vm.heapSize=384
        - tag: google_apis
        - platform: android-22
        - name: Bitrise_Android_Emulator
    - start-android-emulator@1.3.2:
        inputs:
        - emulator_options: "-no-boot-anim -no-window -no-snapshot -verbose"
    - cache-push@2.0.5:
        is_always_run: true
        inputs:
        - ignore_check_on_paths: |-
            $HOME/.gradle/caches/*.lock
            $HOME/.gradle/caches/*.bin
            ./.gradle/*.lock
            ./.gradle/*.bin
        - is_debug_mode: 'true'
        - cache_paths: |-
            $BITRISE_CACHE_DIR
            $HOME/.gradle
            $BITRISE_SOURCE_DIR/node_modules
            $BITRISE_SOURCE_DIR/node_modules/detox
    - script:
        inputs:
        - is_debug: 'yes'
        - content: |-
            #!/bin/bash

            detox build --configuration bitrise.android.emu.release
        title: Detox - Build Android Release App
    - script:
        inputs:
        - content: |-
            #!/bin/bash

            detox test --configuration bitrise.android.emu.release --loglevel trace
        title: Detox - Run E2E Tests on Android
  tests:
    before_run:
    - _project_setup
    - _detox_setup
    - _detox_android
app:
  envs:
  - opts:
      is_expand: false
    PROJECT_LOCATION: android
  • Detox: 9.0.4
  • React Native: 0.57.4
  • Node: 8.12.0
  • Device: Android Emulator (android-19/default/armeabi-v7a/)
  • Xcode: 10.0
  • macOS: 10.13

This is the Detox log using ‘loglevel trace’

configuration="bitrise.android.emu.release" loglevel="trace" artifactsLocation="artifacts/bitrise.android.emu.release.2018-11-01 12-02-48Z" node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:ios:).)*
```
detox[5076] INFO:  [DetoxServer.js] server listening on localhost:50359...
detox[5076] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:50359
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"33b4565e-46f9-14f4-02db-65c7427d5634","role":"tester"},"messageId":0}
detox[5076] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=33b4565e-46f9-14f4-02db-65c7427d5634
detox[5076] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=33b4565e-46f9-14f4-02db-65c7427d5634
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"33b4565e-46f9-14f4-02db-65c7427d5634","role":"tester"},"messageId":0}
 
detox[5076] DEBUG: [exec.js/EXEC_CMD, #0] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/emulator/emulator -list-avds --verbose
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #0] Android_Accelerated_Oreo
Bitrise_Android_Emulator
detox[5076] DEBUG: [exec.js/EXEC_CMD, #1] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb  devices
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-5554	device
detox[5076] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 5554, host: localhost
detox[5076] DEBUG: [exec.js/EXEC_CMD, #2] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "getprop dev.bootcomplete"
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #2] 1
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-5554' })
detox[5076] DEBUG: [exec.js/EXEC_CMD, #3] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "getprop ro.build.version.sdk"
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #3] 19
detox[5076] DEBUG: [exec.js/EXEC_CMD, #4] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #4]   mWakefulness=Awake
  mWakeLockSummary=0x1
  mUserActivitySummary=0x0
  mWakeUpWhenPluggedOrUnpluggedConfig=false
  mUserActivityTimeoutOverrideFromWindowManager=-1
  mUseSoftwareAutoBrightnessConfig=false
  mWaitingForNegativeProximity=false
  mUsingScreenAutoBrightness=false
detox[5076] DEBUG: [exec.js/EXEC_CMD, #5] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/build-tools/28.0.3/aapt dump badging "/Users/vagrant/git/android/app/build/outputs/apk/release/app-release.apk" | grep -e "package: name="
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='com.banese' versionCode='1' versionName='1.0'
detox[5076] DEBUG: [exec.js/EXEC_CMD, #6] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "pm list packages com.banese"
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #6] 
detox[5076] DEBUG: [exec.js/EXEC_CMD, #7] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "pm list packages com.banese.test"
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #7] 
detox[5076] DEBUG: [exec.js/EXEC_CMD, #8] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 install -rg /Users/vagrant/git/android/app/build/outputs/apk/release/app-release.apk
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #8] [  0%] /data/local/tmp/app-release.apk
[  1%] /data/local/tmp/app-release.apk
[  1%] /data/local/tmp/app-release.apk
[  2%] /data/local/tmp/app-release.apk
[  2%] /data/local/tmp/app-release.apk
[  3%] /data/local/tmp/app-release.apk
[  3%] /data/local/tmp/app-release.apk
[  4%] /data/local/tmp/app-release.apk
[  4%] /data/local/tmp/app-release.apk
[  5%] /data/local/tmp/app-release.apk
[  5%] /data/local/tmp/app-release.apk
[  6%] /data/local/tmp/app-release.apk
[  6%] /data/local/tmp/app-release.apk
[  7%] /data/local/tmp/app-release.apk
[  7%] /data/local/tmp/app-release.apk
[  8%] /data/local/tmp/app-release.apk
[  8%] /data/local/tmp/app-release.apk
[  9%] /data/local/tmp/app-release.apk
[  9%] /data/local/tmp/app-release.apk
[ 10%] /data/local/tmp/app-release.apk
[ 11%] /data/local/tmp/app-release.apk
[ 11%] /data/local/tmp/app-release.apk
[ 12%] /data/local/tmp/app-release.apk
[ 12%] /data/local/tmp/app-release.apk
[ 13%] /data/local/tmp/app-release.apk
[ 13%] /data/local/tmp/app-release.apk
[ 14%] /data/local/tmp/app-release.apk
[ 14%] /data/local/tmp/app-release.apk
[ 15%] /data/local/tmp/app-release.apk
[ 15%] /data/local/tmp/app-release.apk
[ 16%] /data/local/tmp/app-release.apk
[ 16%] /data/local/tmp/app-release.apk
[ 17%] /data/local/tmp/app-release.apk
[ 17%] /data/local/tmp/app-release.apk
[ 18%] /data/local/tmp/app-release.apk
[ 18%] /data/local/tmp/app-release.apk
[ 19%] /data/local/tmp/app-release.apk
[ 19%] /data/local/tmp/app-release.apk
[ 20%] /data/local/tmp/app-release.apk
[ 20%] /data/local/tmp/app-release.apk
[ 21%] /data/local/tmp/app-release.apk
[ 22%] /data/local/tmp/app-release.apk
[ 22%] /data/local/tmp/app-release.apk
[ 23%] /data/local/tmp/app-release.apk
[ 23%] /data/local/tmp/app-release.apk
[ 24%] /data/local/tmp/app-release.apk
[ 24%] /data/local/tmp/app-release.apk
[ 25%] /data/local/tmp/app-release.apk
[ 25%] /data/local/tmp/app-release.apk
[ 26%] /data/local/tmp/app-release.apk
[ 26%] /data/local/tmp/app-release.apk
[ 27%] /data/local/tmp/app-release.apk
[ 27%] /data/local/tmp/app-release.apk
[ 28%] /data/local/tmp/app-release.apk
[ 28%] /data/local/tmp/app-release.apk
[ 29%] /data/local/tmp/app-release.apk
[ 29%] /data/local/tmp/app-release.apk
[ 30%] /data/local/tmp/app-release.apk
[ 30%] /data/local/tmp/app-release.apk
[ 31%] /data/local/tmp/app-release.apk
[ 31%] /data/local/tmp/app-release.apk
[ 32%] /data/local/tmp/app-release.apk
[ 33%] /data/local/tmp/app-release.apk
[ 33%] /data/local/tmp/app-release.apk
[ 34%] /data/local/tmp/app-release.apk
[ 34%] /data/local/tmp/app-release.apk
[ 35%] /data/local/tmp/app-release.apk
[ 35%] /data/local/tmp/app-release.apk
[ 36%] /data/local/tmp/app-release.apk
[ 36%] /data/local/tmp/app-release.apk
[ 37%] /data/local/tmp/app-release.apk
[ 37%] /data/local/tmp/app-release.apk
[ 38%] /data/local/tmp/app-release.apk
[ 38%] /data/local/tmp/app-release.apk
[ 39%] /data/local/tmp/app-release.apk
[ 39%] /data/local/tmp/app-release.apk
[ 40%] /data/local/tmp/app-release.apk
[ 40%] /data/local/tmp/app-release.apk
[ 41%] /data/local/tmp/app-release.apk
[ 41%] /data/local/tmp/app-release.apk
[ 42%] /data/local/tmp/app-release.apk
[ 42%] /data/local/tmp/app-release.apk
[ 43%] /data/local/tmp/app-release.apk
[ 44%] /data/local/tmp/app-release.apk
[ 44%] /data/local/tmp/app-release.apk
[ 45%] /data/local/tmp/app-release.apk
[ 45%] /data/local/tmp/app-release.apk
[ 46%] /data/local/tmp/app-release.apk
[ 46%] /data/local/tmp/app-release.apk
[ 47%] /data/local/tmp/app-release.apk
[ 47%] /data/local/tmp/app-release.apk
[ 48%] /data/local/tmp/app-release.apk
[ 48%] /data/local/tmp/app-release.apk
[ 49%] /data/local/tmp/app-release.apk
[ 49%] /data/local/tmp/app-release.apk
[ 50%] /data/local/tmp/app-release.apk
[ 50%] /data/local/tmp/app-release.apk
[ 51%] /data/local/tmp/app-release.apk
[ 51%] /data/local/tmp/app-release.apk
[ 52%] /data/local/tmp/app-release.apk
[ 52%] /data/local/tmp/app-release.apk
[ 53%] /data/local/tmp/app-release.apk
[ 53%] /data/local/tmp/app-release.apk
[ 54%] /data/local/tmp/app-release.apk
[ 55%] /data/local/tmp/app-release.apk
[ 55%] /data/local/tmp/app-release.apk
[ 56%] /data/local/tmp/app-release.apk
[ 56%] /data/local/tmp/app-release.apk
[ 57%] /data/local/tmp/app-release.apk
[ 57%] /data/local/tmp/app-release.apk
[ 58%] /data/local/tmp/app-release.apk
[ 58%] /data/local/tmp/app-release.apk
[ 59%] /data/local/tmp/app-release.apk
[ 59%] /data/local/tmp/app-release.apk
[ 60%] /data/local/tmp/app-release.apk
[ 60%] /data/local/tmp/app-release.apk
[ 61%] /data/local/tmp/app-release.apk
[ 61%] /data/local/tmp/app-release.apk
[ 62%] /data/local/tmp/app-release.apk
[ 62%] /data/local/tmp/app-release.apk
[ 63%] /data/local/tmp/app-release.apk
[ 63%] /data/local/tmp/app-release.apk
[ 64%] /data/local/tmp/app-release.apk
[ 65%] /data/local/tmp/app-release.apk
[ 65%] /data/local/tmp/app-release.apk
[ 66%] /data/local/tmp/app-release.apk
[ 66%] /data/local/tmp/app-release.apk
[ 67%] /data/local/tmp/app-release.apk
[ 67%] /data/local/tmp/app-release.apk
[ 68%] /data/local/tmp/app-release.apk
[ 68%] /data/local/tmp/app-release.apk
[ 69%] /data/local/tmp/app-release.apk
[ 69%] /data/local/tmp/app-release.apk
[ 70%] /data/local/tmp/app-release.apk
[ 70%] /data/local/tmp/app-release.apk
[ 71%] /data/local/tmp/app-release.apk
[ 71%] /data/local/tmp/app-release.apk
[ 72%] /data/local/tmp/app-release.apk
[ 72%] /data/local/tmp/app-release.apk
[ 73%] /data/local/tmp/app-release.apk
[ 73%] /data/local/tmp/app-release.apk
[ 74%] /data/local/tmp/app-release.apk
[ 74%] /data/local/tmp/app-release.apk
[ 75%] /data/local/tmp/app-release.apk
[ 76%] /data/local/tmp/app-release.apk
[ 76%] /data/local/tmp/app-release.apk
[ 77%] /data/local/tmp/app-release.apk
[ 77%] /data/local/tmp/app-release.apk
[ 78%] /data/local/tmp/app-release.apk
[ 78%] /data/local/tmp/app-release.apk
[ 79%] /data/local/tmp/app-release.apk
[ 79%] /data/local/tmp/app-release.apk
[ 80%] /data/local/tmp/app-release.apk
[ 80%] /data/local/tmp/app-release.apk
[ 81%] /data/local/tmp/app-release.apk
[ 81%] /data/local/tmp/app-release.apk
[ 82%] /data/local/tmp/app-release.apk
[ 82%] /data/local/tmp/app-release.apk
[ 83%] /data/local/tmp/app-release.apk
[ 83%] /data/local/tmp/app-release.apk
[ 84%] /data/local/tmp/app-release.apk
[ 84%] /data/local/tmp/app-release.apk
[ 85%] /data/local/tmp/app-release.apk
[ 85%] /data/local/tmp/app-release.apk
[ 86%] /data/local/tmp/app-release.apk
[ 87%] /data/local/tmp/app-release.apk
[ 87%] /data/local/tmp/app-release.apk
[ 88%] /data/local/tmp/app-release.apk
[ 88%] /data/local/tmp/app-release.apk
[ 89%] /data/local/tmp/app-release.apk
[ 89%] /data/local/tmp/app-release.apk
[ 90%] /data/local/tmp/app-release.apk
[ 90%] /data/local/tmp/app-release.apk
[ 91%] /data/local/tmp/app-release.apk
[ 91%] /data/local/tmp/app-release.apk
[ 92%] /data/local/tmp/app-release.apk
[ 92%] /data/local/tmp/app-release.apk
[ 93%] /data/local/tmp/app-release.apk
[ 93%] /data/local/tmp/app-release.apk
[ 94%] /data/local/tmp/app-release.apk
[ 94%] /data/local/tmp/app-release.apk
[ 95%] /data/local/tmp/app-release.apk
[ 95%] /data/local/tmp/app-release.apk
[ 96%] /data/local/tmp/app-release.apk
[ 96%] /data/local/tmp/app-release.apk
[ 97%] /data/local/tmp/app-release.apk
[ 98%] /data/local/tmp/app-release.apk
[ 98%] /data/local/tmp/app-release.apk
[ 99%] /data/local/tmp/app-release.apk
[ 99%] /data/local/tmp/app-release.apk
[100%] /data/local/tmp/app-release.apk
/Users/vagrant/git/android/app/build/outputs/apk/release/app-release.apk: 1 file pushed. 18.4 MB/s (12499739 bytes in 0.648s)
	pkg: /data/local/tmp/app-release.apk
Success
detox[5076] DEBUG: [exec.js/EXEC_CMD, #9] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 install -rg /Users/vagrant/git/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #10] 
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-5554',
  bundleId: 'com.banese',
  launchArgs: 
   { '-e detoxServer': 'ws://localhost:50359',
     '-e detoxSessionId': '33b4565e-46f9-14f4-02db-65c7427d5634' } })
detox[5076] DEBUG: [exec.js/EXEC_CMD, #11] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "pm list instrumentation"
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #11] instrumentation:com.android.emulator.connectivity.test/android.test.InstrumentationTestRunner (target=com.android.emulator.connectivity.test)
instrumentation:com.android.emulator.gps.test/android.test.InstrumentationTestRunner (target=com.android.emulator.gps.test)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.android.smoketest.tests/android.test.InstrumentationTestRunner (target=com.android.smoketest)
instrumentation:com.banese.test/android.support.test.runner.AndroidJUnitRunner (target=com.banese)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
detox[5076] DEBUG: [exec.js/SPAWN_CMD, #12] [pid=5098] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell am instrument -w -r "-e detoxServer ws://localhost:50359 -e detoxSessionId 33b4565e-46f9-14f4-02db-65c7427d5634" -e debug false com.banese.test/android.support.test.runner.AndroidJUnitRunner
detox[5076] DEBUG: [exec.js/EXEC_CMD, #13] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.banese$\""
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #13] 
detox[5076] DEBUG: [exec.js/EXEC_CMD, #14] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.banese$\""
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #14] 
detox[5076] DEBUG: [exec.js/EXEC_CMD, #15] /Users/vagrant/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.banese$\""
detox[5076] TRACE: [exec.js/EXEC_SUCCESS, #15] u0_a52    1563  51    512788 21564 ffffffff b6f7c5cc S com.banese
detox[1563] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-5554',
  bundleId: 'com.banese',
  launchArgs: 
   { '-e detoxServer': 'ws://localhost:50359',
     '-e detoxSessionId': '33b4565e-46f9-14f4-02db-65c7427d5634' },
  pid: 1563 })
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[5076] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] INSTRUMENTATION_STATUS: numtests=1
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] 
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] INSTRUMENTATION_STATUS: stream=
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] 
com.banese.DetoxTest:
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] 
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
detox[5076] TRACE: [exec.js/SPAWN_STDOUT, #12] 
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS: class=com.banese.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
detox[5076] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=33b4565e-46f9-14f4-02db-65c7427d5634
detox[5076] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=33b4565e-46f9-14f4-02db-65c7427d5634
detox[5076] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","messageId":-1000,"params":{}}
 
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeAll()
detox[5076] TRACE: [Detox.js/DETOX_BEFORE_EACH] running test: "Login faz login corretamente"
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeEach({ title: 'faz login corretamente',
  fullName: 'Login faz login corretamente',
  status: 'running' })
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"reactNativeReload","params":{},"messageId":-1000}
detox[5076] TRACE: [DetoxServer.js/MESSAGE] role=tester action=reactNativeReload (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"target":{"type":"Class","value":"com.wix.detox.espresso.EspressoDetox"},"method":"perform","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["adicionarPrimeiraConta"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.action.ViewActions"},"method":"click","args":[]}}]},"messageId":1}
detox[5076] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] TRACE: [Detox.js/DETOX_AFTER_EACH] failed test: "Login faz login corretamente"
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterEach({ title: 'faz login corretamente',
  fullName: 'Login faz login corretamente',
  status: 'failed' })
detox[5076] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterAll()
detox[5076] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"cleanup","params":{"stopRunner":true},"messageId":2}
detox[5076] TRACE: [DetoxServer.js/MESSAGE] role=tester action=cleanup (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
detox[5076] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=33b4565e-46f9-14f4-02db-65c7427d5634)
FAIL e2e/LoginTest.spec.js
  ● Test suite failed to run
    Error: Timeout - Async callback was not invoked within the 500000ms timeout specified by jest.setTimeout.
      at mapper (../node_modules/jest-jasmine2/build/queue_runner.js:41:52)
Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1558.336s
Ran all test suites matching /e2e/i with tests matching "^((?!:ios:).)*$".
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue

So my question is, do you guys know how can I run Detox tests using an android emulator on Bitrise? It works just fine using an iOS simulator.

Thanks

Hi @froesmatheus,

Thanks for the detailed report! Can you please include a build URL as well?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.