是否有可能在运行所有 grails 功能测试之前获得预提交?这意味着如果你有 100 个功能测试,这个钩子(Hook)会被调用一次。
谢谢
最佳答案
是的,使用 Bootstrap 。
import grails.util.Environment
class BootStrap {
def init = { servletContext ->
if (Environment.current == Environment.TEST) {
// test setup here
}
}
def destroy = {
// teardown here (if necessary)
}
}
这将在应用程序以测试模式启动后运行,这是您想要的
关于grails - 在所有功能测试运行之前 Hook ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31828067/