Detox tests do not run on react native android device without reloading the bundle

268 views Asked by At

I'm trying to run Detox tests on react native android device.

The tests are not running, and detox trace shows "CANNOT_FORWARD:

If in different terminal I start react-native bundle and press "R" for reloading it, the tests start to run.

Attached below trace information:

detox[97978] DEBUG: [exec.js/EXEC_CMD, #21] "/Android/sdk/platform-tools/adb" -s emulator-17722 shell "date +\"%m-%d %T.000\""
detox[97978] DEBUG: [exec.js/EXEC_CMD, #22] "/Android/sdk/platform-tools/adb" -s emulator-17722 reverse tcp:64867 tcp:64867
detox[97978] DEBUG: [exec.js/EXEC_CMD, #23] "/Android/sdk/platform-tools/adb" -s emulator-17722 shell "pm list instrumentation"
detox[97978] DEBUG: [exec.js/SPAWN_CMD, #24] [pid=98010] /Android/sdk/platform-tools/adb -s emulator-17722 shell am instrument -w -r -e detoxServer ws://localhost:64867 -e detoxSessionId 2f0e4128-30e3-0737-4ac0-74907e3abed9 -e debug false com.aaa.myWireless.test/androidx.test.runner.AndroidJUnitRunner
detox[97978] DEBUG: [exec.js/EXEC_CMD, #25] "/Android/sdk/platform-tools/adb" -s emulator-17722 shell "ps | grep \"com\.aaa\.myWireless$\""
detox[97978] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=2f0e4128-30e3-0737-4ac0-74907e3abed9)

Any advice how to get detox to work without the need of manually reloading the bundle.

Also tried:

beforeEach(async () => {
    await device.reloadReactNative();
});

But it did not help

0

There are 0 answers