在 maven 命令中为 JUnit Runner 传递 Cucumber Tags/values

Passing Cucumber Tags/values for JUnit Runner in maven command

我正在尝试从 maven 命令(通过命令行 maven 命令)设置黄瓜标签。我正在使用 Junit 运行ner 和 cucumber 选项来指定 运行 并指定 cucumber 选项(格式、功能等)。在 Maven 调用我的 Junit 运行ner 之前,如何我可以将标签设置为黄瓜选项吗?

片段:

Junit 亚军

@RunWith(Cucumber.class) @CucumberOptions ( features={"src/test/resources/Features"},glue = "com.xxxxx.stepDefinition", // tags = {"@运行123"} , 格式={ "pretty","html:target/site/cucumber-pretty","json:target/cucumber.json"} )

public class 运行测试{

}

mvn clean

mvn verify "-Dcucumber.options=--tags @运行123"

当你在项目目录中 运行 这个命令时应该完成这项工作