Search code examples
grailstestingfunctional-testinggeb

How to run suite of Geb Tests in Grails app


I would like to run multiple Geb tests/spec using JUnit's funcionality. Run in Grails app using grails test-app -unit TestSuite do not execute Spec tests. What is a right way?

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

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

         ])

         public class TestSuite {
         }

Solution

  • This will run all functional tests:

    grails test-app functional
    

    This will run only one test suite

    grails test-app functional: TestSuite 
    

    Tested on spock tests on grails 2.3.5 See the example here