黄瓜标签:类型不匹配:无法从 String[] 转换为 String [英] Cucumber tags: Type mismatch: cannot convert from String[] to String

查看:19
本文介绍了黄瓜标签:类型不匹配:无法从 String[] 转换为 String的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@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.

这篇关于黄瓜标签:类型不匹配:无法从 String[] 转换为 String的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆