开发者

Multiple testng.xmls in the same IntelliJ run configuration?

开发者 https://www.devze.com 2023-01-17 07:44 出处:网络
I have a project that has two different modules each with its own set of testng tests.I have separate run config\'s with code coverage enabled for each.I need to run both to gather coverage statistics

I have a project that has two different modules each with its own set of testng tests. I have separate run config's with code coverage enabled for each. I need to run both to gather coverage statistics and was wondering if there was a way to consolidate the coverage data in to a single session.

Is it possible to create a run configuration in IntelliJ that executes the two 开发者_如何学JAVAdifferent testng.xml's?


I don't know specifically about IDEA but TestNG allows you to include XML files:

<suite name="My suite">
  <suite-files>
   <suite-file path="./suite1-1.xml" />
   <suite-file path="./suite1-2.xml" />
  </suite-files>
</suite>

Also, you can run the main TestNG class on multiple XML files, so if you can specify such a command line in an IDEA launch configuration, this should solve your problem:

java org.testng.TestNG suite1-1.xml suite1-2.xml


First, your two testng xml files should be the same name in both module. Then run Maven as usual:

mvn test -pl module1,module2 -Dtestng.suite.xml=testng.xml
0

精彩评论

暂无评论...
验证码 换一张
取 消