Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Detox on a real remotely connected Android device - supported? #1616

Closed
wmaiouiru opened this issue Aug 21, 2019 · 1 comment
Closed

Comments

@wmaiouiru
Copy link

Description:
I have a device on a device farm that I can connect to remotely, and would like to run detox test. Any idea how to make this work?

Node: v10.16.0
Detox: 13.3.0
react-native-cli: 2.0.1
react-native: 0.59.9

I followed the following link to try it locally connected device through USB and it works:
#968

But configuring it to the remotely connected device it gets stuck.

Configuration:

      "android.remote.debug": {
        "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
        "build": "cd android ; ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug ; cd -",
        "type": "android.attached",
        "name": "remote_address:port",
        "session": {
          "server": "ws://127.0.0.1:8099",
          "sessionId": "manualsession"
        }
      },

I had to add -A in ps | grep to find the process id to make it work.

const processes = await this.shell(deviceId, `ps -A | grep "${bundleIdRegex}"`, {silent: true}).catch(() => '');

The place where it gets stuck:

detox[50772] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[50772] TRACE: [exec.js/SPAWN_STDOUT, #13] INSTRUMENTATION_STATUS: class=com.example.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.example.DetoxTest:
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS_CODE: 1
detox[49749] INFO:  [AsyncWebSocket.js] hs AsyncWebSocket: d 2019-08-20T23:29:05.160Z
  1) "before all" hook in "{root}"

  0 passing (5m)
  1 failing

  1) "before all" hook in "{root}":
     Error: Timeout of 300000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

server log with detox run-server --loglevel trace:

detox[50767] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=manualsession
detox[50767] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=manualsession
detox[50767] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=manualsession)
detox[50767] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=manualsession)
@support
Copy link

support bot commented Aug 21, 2019

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Feel free to post your Stack Overflow question here for more visility. We'll take a look at it.

For more information on bots in this reporsitory, read this discussion.

@support support bot closed this as completed Aug 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant