【问题标题】:How to make ignored junit steps in cucumber-jvm cause test scenario to fail如何在 cucumber-jvm 中忽略 junit 步骤导致测试场景失败
【发布时间】:2015-11-21 14:21:38
【问题描述】:

我正在使用 cucumber-jvm 和 appium,使用 eclipse 和 junit。

我的一些测试中途停止工作。它们不会明显地使 junit 测试失败,而是停止工作并忽略剩余的步骤。

当我在 junit 中(通过 eclipse)查看这些步骤时,它们似乎已经通过,直到我深入研究它们并看到步骤已被忽略。

有没有办法将忽略步骤的任何测试场景标记为失败而不是通过?

【问题讨论】:

    标签: java junit cucumber appium cucumber-jvm


    【解决方案1】:

    我假设您有一个带有 @CucumberOptions 注释的 JUnit 测试用例。如果你有这个,你应该能够通过设置strict=true 使忽略的测试失败。例如

    @RunWith(Cucumber.class)
    @CucumberOptions(strict = true)
    public class CucumberRunnerTest {
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多