1

I have some tests as below:

@Test(groups={"smoke"})
public void Test1(){...}

@Test(groups={"smoke", "regression"})
public void Test2(){...}

@Test(groups={"regression"})
public void Test3(){...}

In build.gradle file I have below:

task smoketests(type: Test){
useTestNG() {
   suites "src/test/resources/testng.xml"
   includeGroups "smoke"
}

}

I need to have a gradle syntax to run the smoke/regression tests only using commandline. I have tried this:

./gradlew clean test -P testGroups="smoke"

if I run that, build is successful as below:

:clean
:compileJava
:processResources UP-TO-DATE
:classes
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
:test
BUILD SUCCESSFUL
Total time: 42.253 secs

But it never execute actual tests. Need help

ASM
  • 709
  • 2
  • 8
  • 27

1 Answers1

0

You have created a custom test task, so you need to use that instead of test in your command line:

gradlew clean smoketests
HaC
  • 902
  • 12
  • 24