0

每次我在 android 模拟器上运行 detox/wix 测试用例时都会出现错误。

> android.util.AndroidException: INSTRUMENTATION_FAILED: com.mobile.sampleApp.debug.test/android.support.test.runner.AndroidJUnitRunner
nstrumentation stdout: 
 nstrumentation stdout: 
 android.util.AndroidException: INSTRUMENTATION_FAILED: com.mobile.sampleApp.debug.test/android.support.test.runner.AndroidJUnitRunner
 nstrumeat com.android.commands.am.Instrument.run(Instrument.java:421)
 nstrumeat com.android.commands.am.Am.runInstrument(Am.java:187)
 nstrumeat com.android.commands.am.Am.onRun(Am.java:80)
 nstrumeat com.android.internal.os.BaseCommand.run(BaseCommand.java:54)
 nstrumeat com.android.commands.am.Am.main(Am.java:50)
 nstrumeat com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
 nstrumeat com.android.internal.os.RuntimeInit.main(RuntimeInit.java:285)

包.json

"scripts": {
    "js-app": "RN_E2E_TESTS=E2E react-native start",
    "postinstall": "node ./scripts/postinstall.js && repackager setup",
    "start": "watchman watch-del-all && (adb reverse tcp:8081 tcp:8081 || true) && node node_modules/react-native/local-cli/cli.js start
--reset-cache",
    "xcode": "open ios/example.xcodeproj",
    "android": "cd android && ./gradlew installDebug",
    "e2e:build": "detox build --configuration android.emu.debug",
    "e2e:test":  "detox test --configuration android.emu.debug --reuse -l verbose",
    "e2e:ios": "detox test --configuration ios.sim.debug",
    "e2e-release": "detox test --configuration ios.sim.release"   },
4

1 回答 1

0

删除 package.json 脚本配置中的“--reuse”选项并重建和运行测试解决了这个问题。

"e2e:test":  "detox test --configuration android.emu.debug --reuse -l verbose"

改为--->

"e2e:test":  "detox test --configuration android.emu.debug -l verbose"
于 2018-05-15T06:32:24.457 回答