0
我有一个Groovy类是这样的:如何一个接一个地执行geb helper函数?
// All import stuffs
class Test extends GebSpec{
def setupSpec() {
// Works just fine
}
def setup() {
// Works just fine
}
// Now I have some helper functions
// and I want them to execute exactly in the same order
def "function 1"(){
// code goes here
}
def "function 2"(){
// code goes here
}
def "function 3"(){
// code goes here
}
}
我想确切地执行辅助功能此起彼伏。此时,它们开始随机执行,但它们应该按照如下顺序进行:首先是“功能1”,然后是“功能2”,最后是“功能3”。我尝试在课前添加@Stepwise,但没有帮助。我真的很感激任何建议或帮助。
看看http://stackoverflow.com/questions/13575972/determine-order-of-execution-of-spock-tests –
辅助方法根本不会得到执行,除非你打电话他们自己。如果你指的是测试方法(也称为特征方法),它们将在任何情况下以声明顺序执行(尽管你应该添加@ @ Stepwise)。 –
@FranGarcía:感谢您的链接。我已经尝试过,但它对我没有用。 –