Detox - 测试卡在 Android 中的 device.launchApp 上

Spa*_*aha 5 testing android react-native detox

我正在尝试与我现有的 Android 应用程序集成,该应用程序同时具有 Native 和 ReactNative 组件。我已按照其自述文件中的设置说明进行操作。

问题似乎是,当我detox test -c android.emu.debug在模拟器中运行应用程序启动时,但在一些 console.log 语句之后,我发现测试停留在这一步: await device.launchApp

尽管应用程序在模拟器中正确启动,但排毒似乎无法检测到并继续前进。

我可以与模拟器中启动的应用程序进行交互,并可以按预期浏览活动。

我可以在终端中看到来自排毒的警告消息: 来自终端中排毒的消息

detox[3696] WARN:  [DetoxConnection.js/ERROR, #54058] Action dispatched too early, there is no session to use:

HINT: Please report this issue on our GitHub tracker:
https://github.com/wix/Detox/issues

{
  messageId: -10000,
  type: 'AppWillTerminateWithError',
  params: [Object]
}
Run Code Online (Sandbox Code Playgroud)

这是我的测试:

describe('Example', () => {
  beforeAll(async () => {
    console.log("awaiting launch app");
     await device.launchApp({
      newInstance: true    });
    console.log("done launch app");
  });

  beforeEach(async () => {
    console.log("Awaiting react native");
    //await device.reloadReactNative();
    console.log("Awaited react native");
  });

  it('should have welcome screen', async () => {
    await expect(element(by.id('emailTag'))).toBeVisible();
  });
});
Run Code Online (Sandbox Code Playgroud)