【问题标题】:running multiple test cases independently in a single test suite with out app relaunch在单个测试套件中独立运行多个测试用例,无需重新启动应用程序
【发布时间】:2018-11-03 06:31:08
【问题描述】:

如何在一个独立的测试套件中运行多个测试用例,而无需重新启动应用程序。我目前只使用一个 it() 函数。

it('', async function(){ ...menutestcase, ..homescreenTestcase, ..SettingsTestcase, ...});

我想独立运行所有测试用例,这意味着如果一个测试失败,另一个将继续。目前,可以为每个测试用例使用多个 it() 函数来实现此功能。喜欢

it('', async function(){ ...menutestcase);
it('', async function(){ ...homescreenTestcase,);

但问题是,对于每个 it() 函数调用,应用程序都会为每个 it() 函数调用重新启动,并且每次应用程序启动时我都必须登录。

如果有任何方法可以解决此问题,请提供帮助。

【问题讨论】:

  • 如何将登录名放在beforeAll 块中。
  • @AndreasKöberle 是否有任何设备农场服务,如 AWS-farming,用于在多个设备上测试 react-native 应用程序。有的话请帮忙。

标签: jestjs detox


【解决方案1】:

通过参考 https://github.com/wix/detox/blob/master/detox/test/e2e/f-device.js

我正在使用

// beforeEach(async () => await device.reloadReactNative());

现在,我将其注释掉并仅在第一个测试用例中添加了 device.reloadReactNative()。这样就成功了。

// beforeEach(async () => await device.reloadReactNative());
it('', async function(){ 
         await device.reloadReactNative();
         ...menutestcase
  );
it('', async function(){ ...SettingsTestcase,);
it('', async function(){ ...homescreenTestcase,);

【讨论】:

    猜你喜欢
    • 2012-03-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-07
    • 1970-01-01
    • 1970-01-01
    • 2014-03-25
    • 2013-06-04
    • 1970-01-01
    相关资源
    最近更新 更多