简体   繁体   English

如何使黄瓜-jvm中的忽略的junit步骤导致测试方案失败

[英]How to make ignored junit steps in cucumber-jvm cause test scenario to fail

I am using cucumber-jvm with appium using eclipse and junit. 我正在使用eclipse和junit在appium中使用黄瓜-jvm。

Some of my tests stop working halfway through. 我的某些测试中途停止工作。 They do not overtly fail the junit tests but instead stop working and ignore the remaining steps. 他们不会公开地通过junit测试,而是停止工作并忽略其余步骤。

When I look at these steps in junit (through eclipse) they appear to have passed, until I drill into them and see steps have been ignored. 当我在junit中查看这些步骤(通过Eclipse)时,它们似乎已经通过,直到我深入研究它们并看到步骤已被忽略。

Is there a way to mark any test scenarios with ignored steps as failures rather than as passes? 有没有办法将任何被忽略步骤的测试方案标记为失败而不是通过?

I presume you have a JUnit test case with an @CucumberOptions annotation on it. 我假设您有一个带有@CucumberOptions批注的JUnit测试用例。 If you have this, you should be able to make ignored tests fail the build by setting strict=true . 如果有此设置,则应该可以通过设置strict=true来使被忽略的测试通过构建而失败。 eg 例如

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM