【发布时间】:2017-12-19 08:10:25
【问题描述】:
这似乎是 Grails 提供的一个非常基本的功能,但我无法开始工作。我正在尝试使用here 提供的文档为我的应用程序添加一些 API 测试。
添加测试并运行grails test-app -integration 后,我没有看到测试被执行。下面是命令的输出。
我没有看到任何测试被执行。
以下是我预计会失败的测试。
package myApp
import grails.test.mixin.integration.Integration
import grails.transaction.*
import spock.lang.*
import geb.spock.*
/**
* See http://www.gebish.org/manual/current/ for more instructions
*/
@Integration
@Rollback
class UsersSpec extends GebSpec {
def setup() {
}
def cleanup() {
}
void "visit homepage"() {
when:"The home page is visited"
go '/'
then:"The title is correct"
title == "Welcome to My Application"
}
}
我也尝试过使用以下命令直接运行测试类:
grails test-app myApp.UsersSpec
grails test-app -integration myApp.UsersSpec
grails test-app -functional
grails test-app -functional myApp.UsersSpec
但他们似乎都没有执行所需的测试。
【问题讨论】:
标签: grails functional-testing grails3 web-api-testing