There are 4 classes with tests TestClass1, TestClasss2, TestClass3, TestClass4
. You need to create 2 test suites, each of which will include 2 classes and run them in parallel using the Maven surefire plugin
.
I created 2 xml files with the following content:
<suite name="TestSuite" verbose="1">
<test name="Test">
<classes>
<class name="Tests.TestClass1">
</class>
<class name="Tests.TestClass2">
</class>
</classes>
</test>
</suite>
and
<suite name="TestSuite1" verbose="1">
<test name="Test1">
<classes>
<class name="Tests.TestClass3">
</class>
<class name="Tests.TestClass4">
</class>
</classes>
</test>
</suite>
Also added to pom.xml
inmaven-surefire-plugin
the following:
<configuration>
<suiteXmlFiles>
<suiteXmlFile>Testng.xml</suiteXmlFile>
<suiteXmlFile>Testng1.xml</suiteXmlFile>
</suiteXmlFiles>
<parallel>suite</parallel>
<perCoreThreadCount>false</perCoreThreadCount>
<threadCount>2</threadCount>
</configuration>
Next, I run the project with the command mvn clean test
, the project is going to, but the tests do not start. Where was I wrong?
UPD:
The project is building, but the tests do not start
The file testng.xml is located in the root folder
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.469 sec - in T
estSuite
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.288 s
[INFO] Finished at: 2018-08-27T15:52:21+03:00
[INFO] ------------------------------------------------------------------------