-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
React Native Detox (Android) test fails while running detox test #970
Comments
Well, most likely it crashes. See your adb logcat to find out why. |
I get the same, but also on iOS. @noomorph can u check previous issue I have opened, please? |
Adding logcat txt --------- beginning of system HWC2::Connection)+48) (_ZN4HWC212_GLOBAL__N_122ComposerCallbackBridge9onHotplugEyN7android8hardware8graphics8composer4V2_117IComposerCallback10ConnectionE$9c4dd39c938b72eb758b012354254820+48) (android::hardware::graphics::composer::V2_1::BnHwComposerCallback::_hidl_onHotplug(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function<void (android::hardware::Parcel&)>)+242) (unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+684) android::hardware::Parcel*, unsigned int, std::__1::function<void (android::hardware::Parcel&)>)+129) (android::hardware::graphics::composer::V2_1::BpHwComposerClient::_hidl_registerCallback(android::hardware::IInterface*, android::hardware::details::HidlInstrumentor*, android::spandroid::hardware::graphics::composer::V2_1::IComposerCallback const&)+468) (android::hardware::graphics::composer::V2_1::BpHwComposerClient::registerCallback(android::spandroid::hardware::graphics::composer::V2_1::IComposerCallback const&)+50) (android::spandroid::hardware::graphics::composer::V2_1::IComposerCallback const&)+59) |
I tried to run Detox with RN57 on its test project on both platforms, on macOS Mojave, and everything seems to work. Is there a way for you to provide a demo project which recreates this issue ? |
As per@ noomorph suggestion for crash, after reinstalling the whole code, its working fine and able to run the test. |
I am not able to build using detox commands getting null pointer exception |
@PSG2019 What exactly did you reinstall? I got the same issue and tried re-adding detox to the project mutliple times, but it won't work. |
@boerdjamin My issue resolved due to configuration issues for android. I don't have the exact reason of not working detox code . |
The issue seems resolved? |
Trying to test sample app for a react-native project using detox. While running the app on a simulator using react-native run-android (outside of detox), App is getting installed and launched successfully. After generating the detox build, when I run the detox test command, app is not getting launched & test fails
Detox, Node, Device, Xcode and macOS Versions
Detox: 9.0.4;
React-native-cli: 2.0.1
react-native: 0.57.1
Node: 10.11.0
Device: Android Studio emulator: Nexus_5X_API_26
OS: Windows 8.1
Detox test --configuration android.emu.debug -l verbose log
E:\FourTest>detox test --configuration android.emu.debug -l verbose
configuration="android.emu.debug" loglevel="verbose" artifactsLocation="artifact
s\android.emu.debug.2018-10-04 12-00-03Z" node_modules.bin\jest e2e --config=e
2e/config.json --maxWorkers=1 "--testNamePattern=^((?!:ios:).)*$"
detox[8900] INFO: [DetoxServer.js] server listening on localhost:62341...
detox[8900] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws:/
/localhost:62341
detox[8900] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=01783f0e-0f21-a
9f2-b807-53742114f4c4
detox[8900] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=01783f0
e-0f21-a9f2-b807-53742114f4c4
detox[8900] DEBUG: [exec.js/EXEC_CMD, #0] C:\AndriodSDK\sdk\tools\emulator -list
-avds --verbose
detox[8900] DEBUG: [exec.js/EXEC_CMD, #1] C:\AndriodSDK\sdk\platform-tools\adb
devices
detox[8900] DEBUG: [exec.js/EXEC_CMD, #2] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 shell "getprop dev.bootcomplete"
detox[8900] DEBUG: [exec.js/EXEC_CMD, #3] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 shell "getprop ro.build.version.sdk"
detox[8900] DEBUG: [exec.js/EXEC_CMD, #4] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 shell "dumpsys power | grep "^[ ]m[UW].=""
detox[8900] DEBUG: [exec.js/EXEC_CMD, #5] C:\AndriodSDK\sdk\build-tools\27.0.3\a
apt dump badging "E:\FourTest\android\app\build\outputs\apk\debug\app-debug.apk"
| findstr /C:"package: name="
detox[8900] DEBUG: [exec.js/EXEC_CMD, #6] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 shell "pm list packages com.fourtest"
detox[8900] DEBUG: [exec.js/EXEC_CMD, #7] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 uninstall com.fourtest
detox[8900] DEBUG: [exec.js/EXEC_CMD, #8] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 shell "pm list packages com.fourtest.test"
detox[8900] DEBUG: [exec.js/EXEC_CMD, #9] C:\AndriodSDK\sdk\platform-tools\adb -
s emulator-5554 uninstall com.fourtest.test
detox[8900] DEBUG: [exec.js/EXEC_CMD, #10] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 install -r -g E:\FourTest\android\app\build\outputs\apk\debug\a
pp-debug.apk
detox[8900] DEBUG: [exec.js/EXEC_CMD, #11] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 install -r -g E:\FourTest\android\app\build\outputs\apk\android
Test\debug\app-debug-androidTest.apk
detox[8900] DEBUG: [exec.js/EXEC_CMD, #12] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 shell "am force-stop com.fourtest"
detox[8900] DEBUG: [exec.js/EXEC_CMD, #13] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 shell "pm list instrumentation"
detox[8900] DEBUG: [exec.js/SPAWN_CMD, #14] [pid=10328] C:\AndriodSDK\sdk\platfo
rm-tools\adb -s emulator-5554 shell am instrument -w -r "-e detoxServer ws://loc
alhost:62341 -e detoxSessionId 01783f0e-0f21-a9f2-b807-53742114f4c4" -e debug fa
lse com.fourtest.test/android.test.InstrumentationTestRunner
detox[8900] DEBUG: [exec.js/EXEC_CMD, #15] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 shell "ps | grep "com.fourtest$""
detox[8900] ERROR: [exec.js/EXEC_FAIL, #15] "C:\AndriodSDK\sdk\platform-tools\ad
b -s emulator-5554 shell "ps | grep "com.fourtest$""" failed with code = 1, s
tdout and stderr:
detox[8900] ERROR: [exec.js/EXEC_FAIL, #15]
detox[8900] ERROR: [exec.js/EXEC_FAIL, #15]
detox[8900] DEBUG: [exec.js/EXEC_CMD, #16] C:\AndriodSDK\sdk\platform-tools\adb
-s emulator-5554 shell "ps | grep "com.fourtest$""
detox[8900] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, ca
nnot fw action (sessionId=01783f0e-0f21-a9f2-b807-53742114f4c4)
detox[8900] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 10328]: C:\AndriodSDK
\sdk\platform-tools\adb -s emulator-5554 shell am instrument -w -r -e detoxServe
r ws://localhost:62341 -e detoxSessionId 01783f0e-0f21-a9f2-b807-53742114f4c4 -e
debug false com.fourtest.test/android.test.InstrumentationTestRunner
FAIL e2e/firstTest.spec.js (128.093s)
Example
x should have welcome screen (30ms)
x should show hello screen after tap (5ms)
? Example > should have welcome screen
ed by jest.setTimeout.
? Example > should have welcome screen
? Example > should have welcome screen
? Example > should show hello screen after tap
ed by jest.setTimeout.
? Example > should show hello screen after tap
? Example > should show hello screen after tap
sible().withTimeout(2000);
13 | });
14 | })
Test Suites: 1 failed, 1 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: 128.541s
Ran all test suites matching /e2e/i with tests matching "^((?!:ios:).)*$".
detox[8900] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=01783f0e-0
f21-a9f2-b807-53742114f4c4
child_process.js:651
throw err;
^
Error: Command failed: node_modules.bin\jest e2e --config=e2e/config.json --max
Workers=1 "--testNamePattern=^((?!:ios:).)*$"
at checkExecSyncError (child_process.js:611:11)
at Object.execSync (child_process.js:648:13)
at runJest (E:\FourTest\node_modules\detox\local-cli\detox-test.js:154:6)
at run (E:\FourTest\node_modules\detox\local-cli\detox-test.js:85:7)
at Object. (E:\FourTest\node_modules\detox\local-cli\detox-test.j
s:217: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)
The text was updated successfully, but these errors were encountered: