在使用排毒进行测试时,ReactNative android中出现错误。错误是,“错误:超时超过120000ms。对于异步测试和挂钩,请确保调用了“ done()”;如果返回Promise,请确保它可以解决。”
本机:0.57.7
排毒测试在iOS上运行正常,没有任何问题,但在Android上运行时出现超时错误。不知道该在哪里检查。
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose --grep :ios: --invert --artifacts-location "artifacts/android.emu.debug.2019-04-10 10-27-45Z"
detox[30977] INFO: [DetoxServer.js] server listening on localhost:51629...
detox[30977] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:51629
detox[30977] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=c4ef8798-0ec8-3517-0a6f-56bb03181111
detox[30977] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=c4ef8798-0ec8-3517-0a6f-56bb03181111
detox[30977] DEBUG: [exec.js/EXEC_CMD, #0] /Users/iphone/Library/Android/sdk/emulator/emulator -list-avds --verbose
detox[30977] DEBUG: [exec.js/EXEC_CMD, #1] /Users/iphone/Library/Android/sdk/platform-tools/adb devices
detox[30977] DEBUG: [exec.js/EXEC_CMD, #2] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "getprop dev.bootcomplete"
detox[30977] DEBUG: [exec.js/EXEC_CMD, #3] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "getprop ro.build.version.sdk"
detox[30977] DEBUG: [exec.js/EXEC_CMD, #4] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
detox[30977] DEBUG: [exec.js/EXEC_CMD, #5] /Users/iphone/Library/Android/sdk/build-tools/28.0.3/aapt dump badging "/Users/iphone/Desktop/extra/reactnativegettingstarted/android/app/build/outputs/apk/debug/app-debug.apk" | grep -e "package: name="
detox[30977] DEBUG: [exec.js/EXEC_CMD, #6] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "pm list packages com.plugindemoapp"
detox[30977] DEBUG: [exec.js/EXEC_CMD, #7] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.plugindemoapp
detox[30977] DEBUG: [exec.js/EXEC_CMD, #8] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "pm list packages com.plugindemoapp.test"
detox[30977] DEBUG: [exec.js/EXEC_CMD, #9] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.plugindemoapp.test
detox[30977] DEBUG: [exec.js/EXEC_CMD, #10] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g -t /Users/iphone/Desktop/extra/reactnativegettingstarted/android/app/build/outputs/apk/debug/app-debug.apk
detox[30977] DEBUG: [exec.js/EXEC_CMD, #11] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g -t /Users/iphone/Desktop/extra/reactnativegettingstarted/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
detox[30977] DEBUG: [exec.js/EXEC_CMD, #12] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "pm list instrumentation"
detox[30977] DEBUG: [exec.js/SPAWN_CMD, #13] [pid=30994] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r "-e detoxServer ws://localhost:51629 -e detoxSessionId c4ef8798-0ec8-3517-0a6f-56bb03181111" -e debug false com.plugindemoapp.test/android.support.test.runner.AndroidJUnitRunner
detox[30977] DEBUG: [exec.js/EXEC_CMD, #14] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.plugindemoapp$\""
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #14] "/Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.plugindemoapp$\""" failed with code = 1, stdout and stderr:
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #14]
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #14]
detox[30977] DEBUG: [exec.js/EXEC_CMD, #15] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.plugindemoapp$\""
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #15] "/Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.plugindemoapp$\""" failed with code = 1, stdout and stderr:
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #15]
detox[30977] DEBUG: [exec.js/EXEC_FAIL, #15]
detox[30977] DEBUG: [exec.js/EXEC_CMD, #16] /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell "ps | grep \"com\.plugindemoapp$\""
detox[30977] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=c4ef8798-0ec8-3517-0a6f-56bb03181111)
detox[30977] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 30994]: /Users/iphone/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:51629 -e detoxSessionId c4ef8798-0ec8-3517-0a6f-56bb03181111 -e debug false com.plugindemoapp.test/android.support.test.runner.AndroidJUnitRunner
1) "before all" hook
0 passing (2m)
1 failing
1) "before all" hook:
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
0 passing (2m)
1 failing
1) "before all" hook:
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
detox[30977] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=c4ef8798-0ec8-3517-0a6f-56bb03181111
child_process.js:656
throw err;
^
Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose --grep :ios: --invert --artifacts-location "artifacts/android.emu.debug.2019-04-10 10-27-45Z"
at checkExecSyncError (child_process.js:616:11)
at Object.execSync (child_process.js:653:13)
at runMocha (/Users/iphone/Desktop/extra/reactnativegettingstarted/node_modules/detox/local-cli/detox-test.js:143:6)
at run (/Users/iphone/Desktop/extra/reactnativegettingstarted/node_modules/detox/local-cli/detox-test.js:85:7)
at Object.<anonymous> (/Users/iphone/Desktop/extra/reactnativegettingstarted/node_modules/detox/local-cli/detox-test.js:233:1)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)