【问题标题】:Run Testcases which use setting of configuration file运行使用配置文件设置的测试用例
【发布时间】:2019-05-06 08:48:51
【问题描述】:

我从命令提示符运行测试用例(打字稿文件),并且只提供浏览器选择和并发数等设置。但我想使用 TestCafe 配置文件 testcafe.js 中提到的常用设置。 有人可以帮我提供示例 testcafe 配置文件,以及如何执行测试用例以使用配置文件中提到的设置。

const createTestCafe = require('testcafe');

createTestCafe('localhost', 1337,1338)
.then(tc=>{
    testcafe= tc;
    const runner=testcafe.createRunner();
    return runner
      .browsers(['chrome'])
      .concurrency(3)
      .run();
});

【问题讨论】:

    标签: configuration automated-tests e2e-testing web-testing testcafe


    【解决方案1】:

    在您拥有测试脚本的同一目录中创建您的 .testcaferc.json 配置文件。 TestCafe 将找到配置文件并自动使用它。您不必在编程界面中指定它。

    我建议您参考描述其选项的Configuration File 主题。您可以在 GitHub repository 中找到完整的配置文件示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-13
      • 2018-03-10
      • 2017-01-16
      • 2023-03-28
      • 2020-05-06
      • 2021-06-12
      • 2019-07-16
      • 2018-06-27
      相关资源
      最近更新 更多