【问题标题】:How to re-run only failed scenarios with cypress-repeat?如何使用 cypress-repeat 仅重新运行失败的场景?
【发布时间】:2021-02-09 16:05:32
【问题描述】:

我有一个包含两个场景的 .feature 文件(用 gherkin 语法编写)。

createjap.feature

Feature: Create a job application
    
    Scenario: Schedule an employee from jobs table
    Given I navigate to jobs table
    And I select a job
    When I schedule an employee
    Then I should see the employee scheduled in that job

    Scenario: Schedule an employee from planner
    Given I navigate to planner page

我使用以下脚本命令来运行这些场景:

npx cypress-repeat run -n 3 --until-passes

它会运行 createjap.feature 文件 3 次,直到所有测试都通过。我发现如果一个测试失败而另一个通过,那么通过测试的那个会再次运行。随着项目的发展,这可能会对测试的执行时间产生很大影响。

是否有任何参数可以只运行失败的测试?

【问题讨论】:

    标签: cypress


    【解决方案1】:

    只需添加--only-failed:

    npx cypress-repeat run -n 3 --until-passes --only-failed
    

    【讨论】:

    • 它不起作用。输出为:错误:未知选项:--only-failed
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    • 2012-04-07
    • 1970-01-01
    • 2015-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多