Karate 如何在空手道中参数化jenkins的Cumber选项标签

Karate 如何在空手道中参数化jenkins的Cumber选项标签,karate,Karate,我有下面的java类,它使用cucumberOptions运行 @CucumberOptions(标记={@userManagement}) 公共类IC\U API\U测试\U运行程序{ 这里是跑步者代码 } 不,您不能像那样动态更改@CucumberOptions 使用API动态选择测试,请参见以下示例: 然后这样做(请根据您的环境进行更改): 工作非常好:)感谢您快速准确的回复:) From jenkins I am passing below command ti run the test

我有下面的java类,它使用cucumberOptions运行

@CucumberOptions(标记={@userManagement}) 公共类IC\U API\U测试\U运行程序{ 这里是跑步者代码 }


不,您不能像那样动态更改
@CucumberOptions

使用API动态选择测试,请参见以下示例:

然后这样做(请根据您的环境进行更改):

工作非常好:)感谢您快速准确的回复:)
From jenkins I am passing below command ti run the tests

clean test "-Dkarate.env=$WhereToRun" "-Dbvt.tags=@userManagement"

I am able to fetch the value of 'bvt.tags' using below command
bvtTags = karate.properties['bvt.tags'];

Now I need to pass the 'bvtTags' value to the CucumberOptions.

I tried

    @CucumberOptions(tags = {"bvtTags"})
public class IC_API_Tests_Runner {
  runner code here
}
But 'bvtTags' value is not substituted in the CucumberOptions. But I am able to print the value of 'bvtTags' with print statement in karate code.

Any help will be great help
String tags = System.getProperty("bvt.tags");
List<String> tags = Arrays.asList(tags);
-Dkarate.options="--tags @userManagement"