有没有办法让同一个函数有多个步骤定义(同一类型)?类似于:
@Then("^it's do something$")
@Then("^it's do another thing$")
public void this_is_my_function() throws Throwable {
// Do something
}我现在认为,在Behat (PHP)和Specflow (C#)中,这是可能的。
我得到以下错误:
Error:(86, 5) java: cucumber.api.java.en.Then is not a repeatable annotation type我发现一个post在谈论这个可重复的问题,但是下面的解决方案不起作用。
@Thens({
@Then("^it's do something$")
@Then("^it's do another thing$")
})我想我应该将@Thens定义为一个新的注释类型,但我只想依赖于库中的内容。没有其他的变通方法吗?
发布于 2015-09-30 23:47:37
你可以将它组合成一个@Then:
@Then("^(?:it's do something|it's do another thing)$")
public void this_is_my_function() throws Throwable {
// Do something
}https://stackoverflow.com/questions/31903772
复制相似问题