Grails Geb测试执行顺序

sno*_*ndy 3 grails functional-testing spock geb

在我的grails应用程序中,我使用Spock和Geb来执行功能测试.

由于所有测试都在同一个数据库上运行,因此我想提供正在执行CRUDSpec类的顺序.如何指定?

  1. 一流测试博客作者创作
  2. 第二类,假设第一次测试成功运行,测试创建后
  3. 第三课为帖子添加评论

sno*_*ndy 6

事实证明,订单可以指定如下:

grails -Dserver.port=8090 test-app functional: LoginCRUDSpec,PayeeCRUDSpec
Run Code Online (Sandbox Code Playgroud)

使用此处的包的另一个示例:

// Run all tests in the “admin” package 
grails test-app functional: admin.**.* 

// Run all tests in the “cart” package 
grails test-app functional: cart.**.* 
Run Code Online (Sandbox Code Playgroud)

使用no- arg'grails test-app ' 订购测试的最终方法是按字母顺序命名测试类.

T001_LoginCRUDSpec
T002_PayeeCRUDSpec
T003_ServiceCRUDSpec
T004_DescrParamCRUDSpec
Run Code Online (Sandbox Code Playgroud)