繁体   English   中英

如果Maven / Cucumber测试失败,请执行操作?

[英]Perform action if Maven / Cucumber test fails?

我在Maven工作中进行了一组黄瓜测试。 如果测试失败,我将如何执行特定操作?

RunnerTest.Java

import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@Cucumber.Options(format = {"html:target/test-report", "json:target/test-report.json", "junit:target/test-report.xml"}, 
features = "src/test/resource"
)
public class RunnerTest {
}

我认为您应该使用TestWatcher规则。 这里的更多信息: 有关失败回调/方法的JUnit

暂无
暂无

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

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