处理测试中预期的失败

发布于 2024-11-10 07:19:25 字数 285 浏览 0 评论 0原文

背景:我有一个相对较大的 Cucumber 测试套件。问题是,有几个测试用例会由于已知的错误而失败,这些错误可能在一两个月内不会得到修复。这意味着每当我自己或其他人需要运行测试套件时,我们都会遇到几次失败,然后必须花时间挖掘测试结果并找出哪些是预期的,哪些是新的。

快速而肮脏的解决方案是简单地注释掉测试用例。我遇到的问题是,当错误被修复时,不能保证注释掉的测试用例将被取消注释。

问题:Cucumber 中是否有一种简单的方法来区分预期失败和意外失败?

Background: I have a relatively large Cucumber test suite. The problem is that there are several test cases that will fail due to known bugs that probably won't be fixed for a month or two. This means that whenever myself or someone else needs to run the test suite, we get several failures and then have to spend time digging through the test results and figuring out which ones were expected and which ones are new.

The quick and dirty solution is to simply comment the test cases out. The problem I have with that is that when the bugs are fixed there is no guarantee that the commented out test case will be uncommented.

Question: Is there a simple method in Cucumber to separate the expected failures from the unexpected ones?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撧情箌佬 2024-11-17 07:19:25

你可以将它们标记为 @wip

默认的 cucumber 调用将忽略 @wip 场景

@wip 
Scenario: Something

顺便说一句

rake cucumber:ok #will run all the scenens except the @wip those

rake cucumber:wip #will run只是 @wip 标记的场景

rake cucumber #与 rake cucumber 相同的行为:ok

You can tag them as @wip

The default cucumber call will ignore the @wip scenarios

@wip 
Scenario: Something

Btw

rake cucumber:ok #will run all the scenarions except the @wip ones

rake cucumber:wip #will run just the @wip tagged scenarios

rake cucumber #same behavior as rake cucumber:ok

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文