Detox: Launch on Android fails - DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action

Description

Currently as it stands my app builds fine and launches like normal when running react-native run-android. It is when I try to run the detox test is that things fail. The app will launch on my device shortly there after it just hangs and eventually crashes. I did the initial set up with android, and ran the detox-cli to add the e2e folder with tests as well.

Steps to Reproduce

Running: detox test -c debug

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 8.2.3
  • React Native: 0.55
  • Node: 8.11.3
  • Device: Android - Pixel 2 -hardware device
  • Xcode: n.a
  • macOS: n.a
  • Windows: 10

Device and verbose Detox logs

package.json: { "name": "example", "version": "0.1.0", "private": true, "devDependencies": { "babel-preset-react-native-stage-0": "1.0.1", "jest": "22.4.3", "jest-react-native": "18.0.0", "react-test-renderer": "16.3.0-alpha.1" }, "scripts": { "start": "react-native start", "android": "react-native run-android", "ios": "react-native run-ios", "test": "jest" }, "jest": { "preset": "react-native" }, "dependencies": { "detox": "^8.2.3", "mobx": "4.3.0", "mobx-react": "5.1.2", "react": "16.4.1", "react-native": "0.55", "react-native-action-button": "2.8.4", "react-native-background-fetch": "2.4.3", "react-native-battery": "^0.1.15", "react-native-camera": "1.1.0", "react-native-device-info": "0.21.5", "react-native-dialog": "^5.1.0", "react-native-dropdownalert": "3.5.0", "react-native-elements": "0.19.1", "react-native-exception-handler": "https://samrenick@bitbucket.org/samrenick/react-native-exception-handler.git", "react-native-geocoder": "0.5.0", "react-native-geolocation-service": "^1.1.0", "react-native-maps": "http://miguelquintana@bitbucket.org/miguelquintana/react-native-maps.git", "react-native-navigation-actions": "1.0.4", "react-native-numeric-input": "1.3.1", "react-native-popup-menu": "0.13.2", "react-native-signature-capture": "https://samrenick@bitbucket.org/cxrd/react-native-signature-capture.git", "react-native-simple-toast": "^0.0.8", "react-native-sound": "0.10.9", "react-native-sqlite-storage": "^3.3.6", "react-native-vector-icons": "4.6.0", "react-navigation": "2.6.2" }, "detox": { "configurations": { "debug": { "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..", "type": "android.attached", "name": "FA79E1A07174" }, "release": { "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..", "type": "android.attached", "name": "FA79E1A07174" } }, "test-runner": "jest" } }

detox log: `configuration=“debug” loglevel=“verbose” artifactsLocation=“artifacts\debug.2018-08-29 20-37-01Z” node_modules.bin\jest e2e --config=e2e/config.json --maxWorkers=1 “–testNamePattern=^((?!:ios:).)$" detox[67084] INFO: [DetoxServer.js] server listening on localhost:54130… detox[67084] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:54130 detox[67084] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48 detox[67084] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48 detox[67084] DEBUG: [exec.js/EXEC_CMD, #0] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb devices detox[67084] DEBUG: [exec.js/EXEC_CMD, #1] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell dumpsys power | findstr /R /C:“^[ ]m[UW].=” detox[67084] DEBUG: [exec.js/EXEC_CMD, #2] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\build-tools\28.0.0\aapt dump badging “C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\debug\app-debug.apk” | findstr /C:“package: name=” detox[67084] DEBUG: [exec.js/EXEC_CMD, #3] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 uninstall com.atether detox[67084] DEBUG: [exec.js/EXEC_CMD, #4] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 uninstall com.atether.test detox[67084] DEBUG: [exec.js/EXEC_CMD, #5] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell getprop ro.build.version.sdk detox[67084] DEBUG: [exec.js/EXEC_CMD, #6] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 install -r -g C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\debug\app-debug.apk detox[67084] DEBUG: [exec.js/EXEC_CMD, #7] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell getprop ro.build.version.sdk detox[67084] DEBUG: [exec.js/EXEC_CMD, #8] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 install -r -g C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk detox[67084] DEBUG: [exec.js/EXEC_CMD, #9] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell am force-stop com.atether detox[67084] DEBUG: [exec.js/EXEC_CMD, #10] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell pm list instrumentation detox[67084] DEBUG: [exec.js/SPAWN_CMD, #11] [pid=26888] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell am instrument -w -r “-e detoxServer ws://localhost:54130 -e detoxSessionId c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48” -e debug false com.atether.test/android.support.test.runner.AndroidJUnitRunner detox[67084] DEBUG: [exec.js/EXEC_CMD, #12] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell ps | findstr /R /C:"com.atether[ ]$” detox[67084] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48)

detox[44968] ERROR: [AsyncWebSocket.js/WEBSOCKET_ERROR] caught error: Error: connect ECONNREFUSED 127.0.0.1:55301 err: Error: connect ECONNREFUSED 127.0.0.1:55301 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14) detox[44968] ERROR: [index.js/DETOX_INIT_ERROR] { Error: connect ECONNREFUSED 127.0.0.1:55301 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14) code: ‘ECONNREFUSED’, errno: ‘ECONNREFUSED’, syscall: ‘connect’, address: ‘127.0.0.1’, port: 55301, type: ‘error’, target: WebSocket { domain: null, _events: { error: [Function: onerror] }, _eventsCount: 1, _maxListeners: undefined, _socket: null, _ultron: null, _closeReceived: false, bytesReceived: 0, readyState: 3, supports: { binary: true }, extensions: null, _binaryType: ‘nodebuffer’, _isServer: false, url: ‘ws://localhost:55301’, protocolVersion: 13, _closeTimer: null, _closeCode: 1006 } } (node:44968) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘addExpectationResult’ of undefined (node:44968) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3) (node:44968) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. child_process.js:644 throw err; ^

Error: Command failed: node_modules.bin\jest e2e --config=e2e/config.json --maxWorkers=1 “–testNamePattern=^((?!:ios:).)*$” at checkExecSyncError (child_process.js:601:13) at Object.execSync (child_process.js:641:13) at runJest (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:154:6) at run (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:85:7) at Object.<anonymous> (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:217:1) at Module._compile (module.js:652:30) at Object.Module._extensions…js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)`

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 23 (2 by maintainers)

Most upvoted comments

the same @leugimmai 😦