【发布时间】:2020-08-24 09:33:36
【问题描述】:
我一直在尝试查找将在下面发布的有关此错误的信息,我进行了所有配置并进行了研究,我正在使用所有内容的最新版本。 但由于我是 Detox 的新手,我假设为 iOS 编写的测试适用于 Android,如果是,请忽略并提供有关如何适应的详细信息。
基本上我得到的错误是这样的:
detox[40905] INFO: [test.js] configuration="android.emu.debug" reportSpecs=true readOnlyEmu=false useCustomLogger=true forceAdbInstall=false DETOX_START_TIMESTAMP=1588961953280 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
detox[40909] INFO: [DetoxServer.js] server listening on localhost:49577...
detox[40909] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
DetoxRuntimeError: Failed to run application on the device
HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process.
at EmulatorDriver._getInstrumentationCrashError (/Users/brunosoko/Documents/appExam/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:165:12)
at EmulatorDriver.instrumentationCloseListener (/Users/brunosoko/Documents/appExam/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:128:67)
at EmulatorDriver._terminateInstrumentation (/Users/brunosoko/Documents/appExam/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:156:12)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at ChildProcess.<anonymous> (/Users/brunosoko/Documents/appExam/node_modules/detox/src/devices/drivers/android/AndroidDriver.js:274:7) {
name: 'DetoxRuntimeError'
}
detox[40909] INFO: Example: should show login screen after tap on Sign in button
我不知道这是一个错误还是我做错了什么。
这是我的package.json
"detox": {
"specs": "",
"configurations": {
"ios.sim.debug": {
"binaryPath": "/Users/brunosoko/Library/Developer/Xcode/DerivedData/AppExam-cwpqhbjlywwwihfaazprzmynvoym/Build/Products/Debug-iphonesimulator/appExam.app",
"type": "ios.simulator",
"name": "iPhone 11"
},
"android.emu.debug": {
"binaryPath": "/Users/brunosoko/Documents/AppExam/android/app/build/outputs/apk/debug/app-debug.apk",
"type": "android.emulator",
"name": "Pixel_3_API_R_2"
}
},
"test-runner": "jest"
},
【问题讨论】:
-
这里要添加的另一个细节是,正如您所看到的,我将它用作黑盒测试工具,我没有应用程序的源代码与测试在同一个存储库中跨度>
-
能否提供模拟器设备的日志?
-
您的应用程序的包名是什么(例如 com.android.test)?另外,你能用最新的排毒重试吗?我们已经应用了一项与权限相关的重要修复,您的日志暗示了这一点。
-
对不起!我犯了一个巨大的错误!我没有正确设置 android 应用程序,之后我没有使用
./gradlew assembleRelease assembleAndroidTest -DtestBuildType=debug构建它!谢谢@d4vidi
标签: android ios react-native detox