反应导航和排毒

时间:2018-06-19 14:59:57

标签: react-native redux react-navigation end-to-end detox

我创建了一个演示项目:https://github.com/timrc/DetoxWithReactNavigation

我有2个场景,简介和登录。滑动简介中的最后一个视图时,它会将您导航到SignIn场景。测试如下。

it('should present sign in scene', async () => {
    await expect(element(by.id('scene:intro'))).toExist();
    await expect(element(by.id('scene:intro'))).toBeVisible();
    await element(by.id('scene:intro::scrollview')).swipe('left');
    await element(by.id('scene:intro::scrollview')).swipe('left');
    await waitFor(element(by.id('scene:sign_in'))).toExist();
});

我正在将redux与react-navigation@1.5.11一起用于导航。问题是它找不到下一个场景(场景:sign_in)。

Timeout - Async callback was not invoked within the 60000ms timeout specified by jest.setTimeout.

  17 |     });
  18 |
> 19 |     it('should present sign in scene', async () => {
     |     ^
  20 |         await expect(element(by.id('scene:intro'))).toExist();
  21 |         await expect(element(by.id('scene:intro'))).toBeVisible();
  22 |         await element(by.id('scene:intro::scrollview')).swipe('left');

  at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
  at Suite.<anonymous> (app/__e2e__/App.spec.js:19:5)
  at Object.<anonymous> (app/__e2e__/App.spec.js:4:1)

有人设法解决吗?

现在,我尝试将超时时间增加到2分钟,但是这没有用。

0 个答案:

没有答案