Is it possible to run multiple TestNG set files in the same configuration in IntelliJ IDEA?

I have several TestNG collection files in my multi-module java project, the structure of which looks like this:

project\ module1\src\test\resources\ suite1.xml suite2.xml module2\src\test\resources\ suite3.xml 

Is it possible to create a launch configuration, including all of these packages in IntelliJ IDEA?

I can create a separate configuration for each of them through Run/Debug Configurations - TestNG - Configuration - Suite , but I see no way to select several files there.

I cannot combine all test packages into one set, because some tests use Before / After Suite methods.

I am using IntelliJ IDEA 14.1.2 Community edition, TestNG 6.1.1.

+4
source share
1 answer

TestNG itself supports the execution of several package files - you can run java org.testng.TestNG suite1.xml suite2.xml suite3.xml

I did not find a way to specify multiple suite.xmls in IntelliJ, so I created a master package using the undocumented suite-files tag. It looks like this:

 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" > <suite-files> <suite-file path="suite1.xml"/> <suite-file path="suite2.xml"/> </suite-files> </suite> 

This package file is launched by IntelliJ and should include all tests with their correct methods before / after.

+7
source

All Articles