使用JUnit 5 @Tag运行JUnit 4测试(在Vintage执行引擎下)。

问题描述 投票:0回答:1
目前,据我所知,Cucumber支持通过老式执行引擎在JUnit 5上运行。

假设我有以下测试跑步者:

@RunWith(Cucumber.class) @CucumberOptions(plugin = { "pretty", "html:target/cucumber" }, features={ "src/test/resources" }, strict = true) @Tag("ACCEPTANCE_TEST") public class TestRunner { }

如果我在JUnit 5中使用定义为“ ACCEPTANCE_TEST”的标记表达式运行它,它将不会被拾取并运行。

但是,如果我使用定义为NOT的表达式运行它(对于测试类而言则是正确的),例如“!UNIT_TEST”,它将被拾取并运行。

如何将JUnit 5标记与JUnit 4测试运行器(例如上面的一个)混合使用,以使其适用于标记表达式的正匹配?

[据我所知,Cucumber支持通过老式执行引擎在JUnit 5上运行。假设我有以下测试运行程序:@RunWith(Cucumber.class)@CucumberOptions(...

junit junit4 junit5 cucumber-junit
1个回答
0
投票
TLDR
© www.soinside.com 2019 - 2024. All rights reserved.