Surefire报告在报告中生成重复结果

我正在跟随MAVEN的SO链接与ANT任务进行SOAPUI自动化,并使用jenkins运行。

它工作正常,并执行。 但Surefire html报告生成相同的testSuite,testCases两次。 在这里输入图像描述

ANT JUnit报告生成正确的报告 在这里输入图像描述

下面是我的pom.xml文件 -

<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>com.amadeus.developers</groupId>
<artifactId>pad-apis</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>PAD API (Self-Services APIs)</name>
<url>http://rndwww.nce.amadeus.net/git/scm/ad/pad-api-regression.git</url>
<description>Automated api test for Amadeus Self-Services APIs</description>

<pluginRepositories>
    <pluginRepository>
        <id>smartbear-sweden-plugin-repository</id>
        <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.9-RC1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.10-FINAL</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId> 
            <version>5.3.0</version>
            <configuration>                 
                <projectFile>${project.basedir}/src/test/PAD-API-Regression-soapui-project.xml</projectFile>                    
                <outputFolder>${project.basedir}/target/surefire-reports</outputFolder>                 
                <junitReport>true</junitReport>
                <exportAll>true</exportAll>
                <printReport>true</printReport>
                <testFailIgnore>true</testFailIgnore>
            </configuration>
            <executions>
                <execution>
                    <id>test-report</id>                
                    <phase>test</phase>
                    <goals>             
                        <goal>test</goal>                           
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
            <artifactId>maven-antrun-extended-plugin</artifactId>
            <executions>
                <execution>
                    <id>test-report</id>                
                    <phase>test</phase>
                    <goals>             
                        <goal>run</goal>                            
                    </goals>
                    <configuration>
                        <tasks>
                            <junitreport todir="target/surefire-reports">
                                <fileset dir="target/surefire-reports">
                                    <include name="**/*.xml"/>
                                </fileset>
                                <report format="noframes" todir="target/site"/>
                            </junitreport>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-junit</artifactId>
                    <version>1.8.0</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-trax</artifactId>
                    <version>1.8.0</version>
                </dependency>
            </dependencies>     
        </plugin>
    </plugins>
</build>
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.20</version>
            <configuration>
                <reportsDirectories>
                    <reportsDirectories>${project.basedir}/target/surefire-reports</reportsDirectories>
                </reportsDirectories>
                <skipTests>true</skipTests>
                <redirectTestOutputToFile>true</redirectTestOutputToFile>
                <linkXRef>false</linkXRef>
                <outputName>report</outputName>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.github.damage-control.report</groupId>
            <artifactId>damage-control-maven-plugin</artifactId>
            <version>1.2</version>
        </plugin>
    </plugins>
</reporting>

我试图修改一些像pom.xml文件中的配置

in surefire plugin

<executions>
      <execution>
        <id>attach-sources</id>
        <goals>
          <goal>jar-no-fork</goal>
        </goals>
      </execution>
</executions>

in ANT task config -

<phase>generate-sources</phase>

没有任何工作。

在pom.xml文件中,我有损坏控制插件也可以生成报告 - 但是损坏控制插件也不会生成正确的报告 -

对于破坏控制报告,我知道生成的.xml / .txt文件不是Selenium Surefire插件生成的正确格式。 这可能是不产生适当的损害控制报告的原因。 因为这是SOAPUI项目 - 是否有任何解决方法可以从SOAPUI项目生成损害控制报告 -

以下是SOAPUI项目和Selenium项目的日志 -

SOAPUI Log-

Status: OK
Time Taken: 9
Size: 3858
Timestamp: Fri Jun 09 09:14:06 CEST 2017
TestStep: API_airport-lists-by-city/country_UtilitiesFamily

----------------- Messages ------------------------------

----------------- Properties ------------------------------
StatusCode: 200
Method: GET
HTTP Version: HTTP/1.1
Endpoint: amadeus.net:8888
 URL: http://..../api/v0/apis/7

---------------- Request ---------------------------
Host: [amadeus.net:8888]
Accept-Encoding: [gzip,deflate]
User-Agent: [Apache-HttpClient/4.1.1 (java 1.5)]
Connection: [Keep-Alive]

GET http://....../api/v0/apis/7 
HTTP/1.1
Accept-Encoding: gzip,deflate
Host: amadeus.net:8888
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Surefire报告日志 -

-------------------------------------------------------------------------------
Test set: com.amadeus.developers.pad.amp.catalogue.Catalogue_TryIt_002_SoapSpec

 Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 22.517 sec - in com.amadeus.developers.pad.amp.catalogue.Catalogue_TryIt_002_SoapSpec

这两种格式都不同,我想这就是damamge-control插件无法生成正确报告的原因。

在这里输入图像描述

但是,如果有一些Surefire-report重复的解决方案并且可以解决soapui的损坏控制插件问题,那将会很有帮助。

链接地址: http://www.djcxy.com/p/60671.html

上一篇: Surefire report generating duplicate result in the report

下一篇: Can soapui maven plugin execute multiple projects parallel?