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

2023-09-08 00:11:33 作者:连晚安都错过

@CucumberOptions 下,使用 tags 选项仅执行一组测试,例如:冒烟测试.我已经编写了如下所述的标签代码:

Under @CucumberOptions, while using tags option to execute only some set of tests, ex: Smoke tests. I have written tags code as mentioned below:

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

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

But i am getting a type mismatch error.

推荐答案

要解决此问题,请不要在标签中使用花括号.只需为下面的代码编写代码

To Fix this problem, do not use curly braces for tags. Just write code for tags like below code

@CucumberOptions(
        tags = "@SmokeTest and @End2End"
        )

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

I am not getting any error after removing curly braces.

 
精彩推荐
图片推荐