首页 文章

SoapUI,Maven,Surefire和Jenkins Integration

提问于
浏览
0

我正在尝试使用maven,surefire和jenkins运行SoapUI xml项目文件 . 一切都很好,maven和jenkins,在构建完成后,Junit报告显示在jenkins中(有非常基本的信息 - testcase名称和状态)

我想使用surefire来显示报告和日志(我可以在target / surfire-report / all * .xml和* .txt中看到日志文件) . 如何配置jenkins以显示surefire报告和日志文件?

这是我的pom.xml文件

<pluginRepositories>
    <pluginRepository>
        <id>smartbear-sweden-plugin-repository</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.3.0</version>
            <configuration>
                <projectFile>${basedir}/src/test/java/Test-API-soapui-project.xml</projectFile>
                <outputFolder>${basedir}/target/surefire-reports/</outputFolder>
                <junitReport>true</junitReport>
                <exportwAll>true</exportwAll>
                <printReport>true</printReport>
            </configuration>
            <executions>
                <execution>
                    <id>soapUI</id>
                    <phase>integration-test</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>com.smartbear.soapui</groupId>
                    <artifactId>soapui</artifactId>
                    <version>5.3.0</version>
                    <exclusions>
                        <exclusion>
                            <groupId>javafx</groupId>
                            <artifactId>jfxrt</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.20</version>
        </plugin>
    </plugins>
</build>

1 回答

  • 1

    不确定你是否已修复此问题,但这就是我的做法 .

    在Jenkins为您的项目构建 add Post-build action 发布junit测试报告结果 . 将 Test report XMLs 设置为指向您查看正在编写的报告的target / surefire-reports目录 . 在下面的示例中,我知道它何时是正确的,因为如果Jenkins能够't find the report xmls it will display a red error message and nothing when it has found the report xmls where you' ve告诉他们他们会 .

    希望这可以帮助 .

    enter image description here

相关问题