IntelliJ run TestNG tests in 1 directory -


i have separated unit , integration tests separate intellij "test sources" directories. when right-click on unit test folder , attempt run tests, integration tests roped in well.

i able right-click on unit test folder , have tests under folder run , same integration tests.

is there way in intellij or going have use testng.xml file accomplish this?

how using 2 test groups , creating 2 run configurations, 1 unit testing , 1 integration testing:

1) dummy test class simulates both categories

import org.testng.annotations.test;  public class categorytests {      @test(groups = "unit")     public void someunittest(){      }      @test(groups = "integration")     public void someintegrationtest(){      } } 

2) unit test ij run config (notice group setup)

unit test config

3) integration test ij run config (again, notice group setup)

integration test config

4) in 1 sample

testng categories


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -