解决:在pom.xml处理添加testng依赖之外,需对testng进行关联
问题描述:当maven项目中下载了testng包,在调用后,执行maven test,未执行testng.xml中指定的测试类。
解决:在pom.xml处理添加testng依赖之外,需对testng进行关联
<build>
<!-- 添加插件 关联testng.xml -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<suiteXmlFiles>
<!-- testng.xml文件路径吗,项目下路径为"res/testng.xml" ,则定义为res/${xmlFileName} -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
更多精彩

