排毒构建挂在device.launchApp函数上

时间:2019-05-06 23:58:48

标签: javascript react-native mocha detox

我在使用以下功能时遇到问题

before(async () => {
  console.log('1'); // this shows up
  await detox.init(config, { launchApp: false });
  console.log('2'); // this shows up
  try {
    console.log('trying'); // this shows up
    await device.launchApp({ permissions: { notifications: 'YES' } });
  } catch (error) {
    console.log('error', error); // I don't get an error until it times out
  }
  console.log('3'); // this never shows up
});

我的代码基于https://github.com/wix/Detox/blob/master/examples/demo-react-native/e2e/init.js

这是我的日志:

me-MacBook-Pro:*****-rn me$ detox test -c ios.sim.debug
detox[21183] INFO:  [test.js] node_modules/.bin/mocha --opts e2e/mocha.opts --configuration ios.sim.debug --grep :android: --invert --artifacts-location "artifacts/ios.sim.debug.2019-05-06 23-51-38Z" "e2e"


1
detox[21185] INFO:  [DetoxServer.js] server listening on localhost:61862...
2
trying
detox[21185] INFO:  [AppleSimUtils.js] com.reme.client.rn.development launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F /Users/*****/Library/Developer/CoreSimulator/Devices/F40204D1-********-3D1521E3FF1D/data/tmp/detox.last_launch_app_log.{out,err}
  1) "before all" hook in "{root}"
cleanup

  0 passing (5m)
  1 failing

  1) "before all" hook in "{root}":
     Error: Timeout of 300000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.




detox[21183] ERROR: [cli.js] Error: Command failed: node_modules/.bin/mocha --opts e2e/mocha.opts --configuration ios.sim.debug --grep :android: --invert --artifacts-location "artifacts/ios.sim.debug.2019-05-06 23-51-38Z" "e2e"

0 个答案:

没有答案