[英]Running testng.xml via pom.xml but build getting failed although no tests fail
[英]Running Testng.xml from POM.xml is not running tests in sequence
我正在运行 testng.xml 文件,使用 POM.xml 添加编译器和万能插件。 它运行测试,但测试顺序与预期不符。 我在 testng.xml 中提到了 10 个类,当我运行 testng.Z0F635D0E0F32E788.CFF78764 时,它按该顺序运行但是当通过 POM.xml 运行时,顺序如下; 首先它运行所有类中提到的所有 0 优先级测试,然后是 1 优先级测试,依此类推。 它应该根据 testng.xml 中提到的类顺序运行测试。 任何快速帮助将不胜感激。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>${jdk.level}</source>
<target>${jdk.level}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
在 testng 依赖项下,需要更改 scope 标记以从测试编译,它解决了该问题,因为它需要在添加插件后编译构建。 它解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.