Gradle run single TestNG method

2012 04 uncle sam 170

This is the shortest remark ever. Just a few word and a few lines of code. So to run single test with Gradle and TestNG you can use one of this approaches:

Run someSpecificFeature method from SomeTest in specific arg.gradle package:

gradle test --tests org.gradle.SomeTest.someSpecificFeature

Run someSpecificFeature method from SomeTest in any package:

gradle test --tests *SomeTest.someSpecificFeature

Run all methods in SomeSpecificTest class:

gradle test --tests *SomeSpecificTest

Run all in specific package:

gradle test --tests all.in.specific.package*

Run all in classes which name starts with IntegTest:

gradle test --tests *IntegTest

gradle test --tests *IntegTest*ui*

Run someTestTask from any UiTest and someTestTask from any WebTest*ui:

gradle someTestTask --tests *UiTest someOtherTestTask --tests *WebTest*ui

Cheers! Thats all;)