Karate 并行运行的标记逻辑
通过并行方法进行标记的逻辑与cucumber选项不同。如果有一些文档就好了 mvn-Doptions=“--tags@integration--tags@x--tags~@wip”不适用于标记为integration或x的场景 根据我的理解,以上表示@CucumberOptions(标记={“@integration”、“@x”、“~@wip”} 如果我给mvn-Doptions=“--tags@integration,@x”,那么它将使用tag integration或x执行场景Karate 并行运行的标记逻辑,karate,Karate,通过并行方法进行标记的逻辑与cucumber选项不同。如果有一些文档就好了 mvn-Doptions=“--tags@integration--tags@x--tags~@wip”不适用于标记为integration或x的场景 根据我的理解,以上表示@CucumberOptions(标记={“@integration”、“@x”、“~@wip”} 如果我给mvn-Doptions=“--tags@integration,@x”,那么它将使用tag integration或x执行场景 public
public static List<String> setTags(String options){
logger.info("Tag input from maven command:"+options);
logger.info("Parsing all the tags");
List<String> allTags = new ArrayList<>();
List<String> tags = Arrays.asList(options.split("--tags"));
for (String tag : tags) {
if (StringUtils.isNotEmpty(tag)) {
logger.info("Tags selected are:" + tag.trim());
allTags.add(tag);
}
}
return allTags;
}
public static List<String> getTags(){
if(StringUtils.isNotEmpty(System.getProperty("options"))) {
return setTags(System.getProperty("options"));
}else throw new RuntimeException("Please select a tag for execution");
}
文件1
@整合
场景:诸如此类
文件2
@x
场景:胡说八道
根据我的理解,以上表示@CucumberOptions(标记={“@integration”、“@x”、“~@wip”}
不,那是错误的。参考这篇博文,它甚至链接到空手道文档:
这应该是你要找的
@CucumberOptions(tags = {"@integration,@x", "~@wip"})
如果您仍然看到问题,我们可以解决-但请遵循以下流程:
@CucumberOptions(tags = {"@integration,@x", "~@wip"})