Testing an Android .apk that's built from Expo's Turtle CLI with Detox

Viewed 415

I'm hoping to confirm my thought process when trying to test an Android application that's built with Expo's Turtle-CLI tool. I've got iOS running well, just need help getting Android working.

I have a build process that will spit out an .apk to build/android.apk. Here's the command that does that

turtle build:android \
       --output $BUILD_DIR/android.apk \
       --username $EXPO_USERNAME \
       --password $EXPO_PASSWORD \
       --config app.config.ts \
       --release-channel $RELEASE_CHANNEL \
       --type apk \
       --mode debug

This successfully outputs the .apk in build.

Here is my detoxrc.json configuration

{
  "testRunner": "jest",
  "runnerConfig": "e2e/config.json",
  "configurations": {
    "ios": {
      "type": "ios.simulator",
      "binaryPath": "build/app-native.app",
      "build": "./scripts/build_test_app ios",
      "device": {
        "type": "iPhone 11"
      }
    },
    "android": {
      "type": "android.attached",
      "binaryPath": "build/android.apk",
      "testBinaryPath": "build/android.apk",
      "build": "./scripts/build_test_app android",
      "device": {
        "adbName": "059aaa47"
      }
    }
  }
}

I then attempt to run my tests with

detox test --configuration android --loglevel trace

Which then yields (more logs at the bottom of this post)

No instrumentation runner found on device 059aaa47 for package com.foobar.mobilern

      at ADB.getInstrumentationRunner (../node_modules/detox/src/devices/drivers/android/exec/ADB.js:250:13)
      at Instrumentation.launch (../node_modules/detox/src/devices/drivers/android/tools/Instrumentation.js:19:24)
      at MonitoredInstrumentation.launch (../node_modules/detox/src/devices/drivers/android/tools/MonitoredInstrumentation.js:18:5)
      at AttachedAndroidDriver._launchInstrumentationProcess (../node_modules/detox/src/devices/drivers/android/AndroidDriver.js:284:5)
      at AttachedAndroidDriver._launchApp (../node_modules/detox/src/devices/drivers/android/AndroidDriver.js:267:7)
      at AttachedAndroidDriver._handleLaunchApp (../node_modules/detox/src/devices/drivers/android/AndroidDriver.js:120:7)
      at AttachedAndroidDriver.launchApp (../node_modules/detox/src/devices/drivers/android/AndroidDriver.js:91:12)
      at Device._doLaunchApp (../node_modules/detox/src/devices/Device.js:85:19)
      at traceCall (../node_modules/detox/src/utils/trace.js:41:20)

If I omit the testBinaryPath key from .detoxrc.json, then I get this result.

Running adb -s 059aaa47 shell pm list instrumentation on the test device yields an empty response, so I'm inclined to believe that some testing setup isn't being completed thoroughly and/or perhaps I'm thinking about this wrong.

I guess the gist of my question is, is it possible to test one .apk without having to make use of some sort of testing harness / binary?

Full Log Output

0 Answers
Related