2016-03-09 68 views
-1

以下是我的Ant構建工具,這是工作的罰款,以生成HTML report.I要使用替代的build.xml的pom.xmlMaven的:Junit的HTML報告香皂測試用例

<?xml version="1.0"?> 
     <project name="SoapTest" default="testreport" basedir="."> 
      <target name="soapui"> 
     <exec dir="." executable="C:/Program Files/SmartBear/SoapUI-5.2.0/bin/testrunner.bat"> 
     <arg line="-j -f 'C:/soapreports' 'C:/SoapUI/APRS_SoapUI_Project.xml'"/> 
     </exec> 
     </target> 
      <target name="testreport" depends="soapui"> 
      <junitreport todir="C:/soapreports"> 
      <fileset dir="C:/soapreports"> 
      <include name="TEST-*.xml"/> 
      </fileset> 
      <report todir="C:/soapreports/HTML" styledir="C:/Program Files/apache-ant-1.9.6/etc" format="noframes"> 
      </report> 
      </junitreport> 
     </target> 
    </project> 
+0

您是否嘗試了文檔? https://www.soapui.org/test-automation/maven/maven-2-x.html – SiKing

回答

1

可以使用遵循pom.xml配置從Maven運行SoapUI項目並獲取JUnit報告。使用SoapUI_Maven作爲參考

<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.soapui.tests</groupId> 
    <artifactId>SoapUI_Maven</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <properties> 
     <soapui.plugin.version> 
      5.1.2 
     </soapui.plugin.version> 
    </properties> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>smartbear-sweden-plugin-repository</id> 
      <url>http://smartbearsoftware.com/repository/maven2/</url> 
     </pluginRepository> 
    </pluginRepositories> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>com.smartbear.soapui</groupId> 
       <artifactId>soapui-pro-maven-plugin</artifactId> 
       <version>${soapui.plugin.version}</version> 
       <dependencies> 
        <dependency> 
         <groupId>org.reflections</groupId> 
         <artifactId>reflections</artifactId> 
         <version>0.9.10</version> 
        </dependency> 
       </dependencies> 
       <configuration> 
        <settingsFile>${basedir}/src/config/soapui-settings.xml</settingsFile> 
        <junitReport>true</junitReport> 
        <printReport>true</printReport> 
        <coverage>${project.build.directory}/reports</coverage> 
       </configuration> 
       <executions> 
        <execution> 
         <phase>integration-test</phase> 
         <goals> 
          <goal>test</goal> 
         </goals> 
         <configuration> 
          <testFailIgnore>true</testFailIgnore> 
          <outputFolder>${project.build.directory}/reports</outputFolder> 
          <projectFile>"Your SoapUI project full path"</projectFile> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
</project>