【问题标题】:TestCafe : How to run all tests except few testsTestCafe : 如何运行除少数测试之外的所有测试
【发布时间】:2020-12-24 08:52:30
【问题描述】:

我很少有测试需要很长时间,因为后端启动的作业很少,需要很长时间。我想要进行一些控制,以便我可以将所有测试作为我的回归套件的一部分运行,除了这几个长时间运行的测试。

我不想在所有测试中指定元数据,如果我可以在长时间运行的测试中添加元数据并以某种方式运行除元数据之外的所有测试,那就太好了。

假设我在长时间运行的测试中添加元数据为longRunning=true,我可以使用以下命令运行测试: node node_modules/testcafe/bin/testcafe not --test-meta longRunning=true

除了元数据longRunning=true之外,还有什么方法可以执行所有测试

【问题讨论】:

    标签: testing automation automated-tests e2e-testing testcafe


    【解决方案1】:

    您不能将其作为命令的一部分执行(截至 2020 年 12 月),但您可以通过编程方式执行此操作,如下所述:https://devexpress.github.io/testcafe/documentation/reference/testcafe-api/runner/filter.html

    【讨论】:

    【解决方案2】:

    此外,TestCafe 还提供了另一种跳过特定测试的方法,即skip method

    fixture `My test fixture`
    .page`https://www.my-test-page-com`;
    
      test('Test 1', () => {}); // This test will run
      test.skip('Test 2', () => {}); // This test will be skipped
      test('Test 3', () => {}); // This test will run too
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-11
      • 2017-12-09
      • 2023-04-11
      • 2022-06-20
      • 1970-01-01
      • 1970-01-01
      • 2020-03-04
      • 1970-01-01
      相关资源
      最近更新 更多