Cucumber-JVM 5 - 你可以 append/add 一个标签到你的 testRunner class 中定义的标签吗?

Cucumber-JVM 5 - Can you append/add a tag to the ones defined in your testRunner class?

我有这样一个 testRunner:

@CucumberOptions( tags = {"@smoke"})
@RunWith(Cucumber.class)
public class SmokeRunner_IT {

}

我想 运行 我的一部分功能。 我也有针对不同环境的功能标签(例如 @dev@test

当我 运行 通过 maven 进行测试时,我想将环境标记添加到我的 testRunner 中已经定义的 @smoke 标记中。这可能吗?在我运行:

的那一刻
mvn verify -Dcucumber.filter.tags="@dev"

它覆盖了我在 testRunner 中定义的 @smoke 标签。

我找到了 (有解决方案)。但解决方案适用于旧版本的黄瓜,不适用于黄瓜 5。

目前我正在使用 Cucumber 5.6.0

简而言之;这是不可能的。

考虑从跑步者中移除标签过滤器 class:

@RunWith(Cucumber.class)
public class RunCucumberIT {

}

并从 CLI 中指定确切的功能集。

mvn verify -Dcucumber.filter.tags="@smoke and @dev"