【问题标题】:How to run suite of Geb Tests in Grails app如何在 Grails 应用程序中运行 Geb 测试套件
【发布时间】:2016-04-20 08:38:53
【问题描述】:

我想使用 JUnit 的功能运行多个 Geb 测试/规范。使用grails test-app -unit TestSuite 在 Grails 应用程序中运行,不要执行 Spec 测试。什么是正确的方法?

import org.junit.runner.RunWith
     import org.junit.runners.Suite

         @RunWith(Suite.class)
         @Suite.SuiteClasses([
             HotelPageSpec.class,
             TourSearchSpec.class,
             MyToursSpec.class,

         ])

         public class TestSuite {
         }

【问题讨论】:

    标签: grails testing functional-testing geb


    【解决方案1】:

    这将运行所有功能测试:

    grails test-app functional
    

    这将只运行一个测试套件

    grails test-app functional: TestSuite 
    

    在 grails 2.3.5 上的 spock 测试中测试 见例子here

    【讨论】:

    • 谢谢。但是当我尝试运行 TestSuite 时,没有执行任何规范。 Server running. Browse to http://localhost:8080/ ....... |Compiling 2 source files . |Server stopped ......... |Tests PASSED - view reports
    猜你喜欢
    • 1970-01-01
    • 2012-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-09
    相关资源
    最近更新 更多