【发布时间】:2015-06-22 16:12:53
【问题描述】:
我的要求是通过 maven 运行多个 SOAPUI 测试用例,使用 jenkins 自动构建并生成测试结果报告。 除了最后一部分,我都成功了。
现在我想生成所有测试用例结果的 html 报告。 我使用 maven-surefire-report-plugin 这样做。
我关注了这篇文章 http://maven.apache.org/surefire/maven-surefire-report-plugin/usage.html 测试用例成功,报告生成成功,但报告中没有记录。
我在这里错过了什么吗?是否有任何配置参数来设置生成报告的源路径之类的?
surefire 报告在 ${project.build.directory}/site 文件夹中生成。 SOAPUI 测试用例的输出文件在 ${project.build.directory}/reports 文件夹中生成。
这是我写的pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>soapTest</groupId>
<artifactId>soapTest</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 SoapUI Sample</name>
<url>http://maven.apache.org</url>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.2</version>
<configuration>
<projectFile>soapui-project.xml</projectFile>
<outputFolder>${project.build.directory}/test-classes</outputFolder>
<junitReport>true</junitReport>
<exportAll>true</exportAll>
<printReport>true</printReport>
<testSuite>Authenticate</testSuite>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.7.2</version>
</plugin>
</plugins>
</reporting>
【问题讨论】:
-
你是如何在 jenkins 中启用万无一失的报告的?我添加了surefire插件,但报告仍然使用基本的junit报告而不是surefire报告
标签: maven junit jenkins soapui maven-surefire-plugin