当我使用“Run as Junit Tests”运行黄瓜测试时,测试使用适当的标签正常运行。
同样,当我使用“ Maven”运行黄瓜测试时,测试使用适当的标签可以正常运行,前提是我在 runner 类中提到了标签。
@Cucumber.Options(format={"pretty", html:target/cucumber","json:target/cucumber.json"},tags= {"@smokeTest"})
但是我希望能够将标签作为参数提供给 mvn test 命令,以运行测试用例,并且我正在使用以下命令。
mvn test -Dcucumber.options="--tags @tagTest"
但无论我的标签如何,它都会运行所有测试用例。
同样,当我使用命令时mvn test -Dcucumber.options="--tags @tagTest"
,我在跑步者类中没有提到任何标签
@Cucumber.Options(format={"pretty",html:target/cucumber","json:target/cucumber.json"})
请让我知道我哪里出错了?
这是 runnerTest 代码:
import org.junit.runner.RunWith;
import cucumber.junit.Cucumber;
@RunWith(Cucumber.class)
@Cucumber.Options(format={"pretty", "html:target/cucumber","json:target/cucumber.json"})
public class runnerTest {
}
随附的