I'm new to Geb and would like to be able utilize something like Categories 
in JUnit to annotate tests, and then be able to execute only tests with 
certain categories/annotations.

I've tried annotating some tests and then executing a Gradle task, as noted 
at https://github.com/junit-team/junit4/wiki/Categories, but have not been 
successful.

Is there another way to do this in Geb?  Or, does anyone have any 
suggestions on how I could use JUnit Categories.

Example Test I tried:

package GebishOrgTest

import geb.junit4.GebReportingTest
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.experimental.categories.Category
import org.junit.runners.JUnit4

interface FastTest { /* category marker */ }

@RunWith(JUnit4)
class GebishOrgTest extends GebReportingTest {

    @Category (FastTest)
    @Test
    void canGetToTheCurrentBookOfGeb() {
        to GebishOrgHomePage

        manualsMenu.open()

        //first link is for the current manual
        assert manualsMenu.links[0].text().startsWith("current")

        manualsMenu.links[0].click()

        at TheBookOfGebPage
    }

}


Example Gradle Task:

task useCategory(type: Test) {

useJUnit {

        includeCategories 'GebishOrgTest.FastTest'

    }

}




-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/beef3ac1-e1ea-4a7b-a104-0c0dc19e2f54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to