Cucumber 标签:类型不匹配:无法从 String[] 转换为 String

Jan*_*ddy 1 cucumber

在 下@CucumberOptions,同时使用标签选项仅执行一些测试集,例如:烟雾测试。我已经编写了如下所述的标签代码:

@CucumberOptions(
        tags = {"@SmokeTest"} // <<< Type mismatch: cannot convert from String[] to String
        )
Run Code Online (Sandbox Code Playgroud)

但我收到类型不匹配错误。

Jan*_*ddy 6

要解决此问题,请不要对标签使用花括号。只需为如下代码编写标签代码

@CucumberOptions(
        tags = "@SmokeTest and @End2End"
        )
Run Code Online (Sandbox Code Playgroud)

删除花括号后我没有收到任何错误。