我有一个像这样的Groovy类:
// 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,但这没有帮助。我真的很感激任何建议或帮助。
答案 0 :(得分:0)
spock不会将其识别为spock测试,除非它以“spec”字样结束
所以你需要做两次修改。 1.将其作为testspec 2.使用@stepwise注释。 它应该工作