我已将 SOAPUI 与 Maven 集成,以便我的测试用例可以使用 Maven 构建来执行。
效果很好。
但是此集成不会创建任何我可以引用以了解测试结果的格式化报告,例如 HTML 输出。
同样,我在 POM.XML 中添加了一个插件(如下所示)
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</reporting>
这会创建报告,但它会针对我的项目中的所有 junit 测试用例执行此操作。
我看不到任何有关 SOAPUI 测试用例的报告。
如何使 Surefire 报告包含 SoapUI 测试结果?
最佳答案
刚刚让它在我的设置中工作。
解决方案是“maven-surefire-report-plugin”将“TEST*.xml”转换为HTML格式,并将其放置在“/targets/surefire-report”中。因此请确保“soapui-maven-plugin”正在将“soapui-maven-plugin”的输出放在“/targets/surefire-report”目录中。
请参阅下面的示例
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.2</version>
<executions>
<execution>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<projectFile>${baseDirectory}/src/test/integration/resources/Mobile-Ads-soapui-project.xml</projectFile>
<iface>mobileAdsService</iface>
<outputFolder>${baseDirectory}/target/surefire-reports/</outputFolder>
<junitReport>true</junitReport>
<exportwAll>true</exportwAll>
<printReport>true</printReport>
<testFailIgnore>false</testFailIgnore>
</configuration>
</execution>
</executions>
</plugin>
关于java - Maven 中的 SOAPUI 测试报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26798171/