请看截图我试图用黄瓜选项运行我的黄瓜跑步者,并尝试使用标记,但是它不起作用。
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
dryRun = false,
strict = true,
monochrome = true,
features = {"src/test/resources/"},
glue = {"com.learning"},
plugin = {"pretty",
"html:target/site/cucumber-html",
"json:target/cucumber1.json"},
tags = {"@BookingFlight"}
)
public class MyRunner {
}
Error is: java: annotation value not of an allowable type[enter image description here][1]
[1]: https://i.stack.imgur.com/P6OuL.png发布于 2021-01-18 19:26:09
您必须删除标记属性中的花括号:
@RunWith(Cucumber.class)
@CucumberOptions(
dryRun = false,
strict = true,
monochrome = true,
features = {"src/test/resources/"},
glue = {"com.learning"},
plugin = {"pretty",
"html:target/site/cucumber-html",
"json:target/cucumber1.json"},
tags = "@BookingFlight"
)
public class MyRunner {
}您可以在一个字符串中指定多个标记,即:"@BookingFlight或@BookingGeneral“
https://stackoverflow.com/questions/65747190
复制相似问题