如何告诉Maven和TestNG运行特定的测试类和suite.xml文件?
我希望能够使用maven从我的testng套件中运行特定的测试类.我的测试类取决于testngsuite.xml文件中的参数.我可以运行mvn test -DsuiteXmlFile=mysuite.xml
或mvn test -Dtest=sometest
.有什么办法可以将两者结合起来?
I want to be able to run a specific test class from my testng suite using maven. My test classes are dependent on parameters from the testngsuite.xml file. I can run mvn test -DsuiteXmlFile=mysuite.xml
or mvn test -Dtest=sometest
. Is there any way to combine these two?
This link shows how to do one of the other but not both. How do I tell Maven and TestNG to run either a specific test class or a suite.xml file?
套件文件用于定义测试运行.
Suite files are used to define a test run.
这意味着如果只需要一个测试,只需编写一个专用的套件文件.
That means if you want only one test, just write a dedicated suite file.