2015-08-26 73 views
1

我想用Allure生成Soapui-PRO執行報告。我下載了Allure-Maven插件2.2。我更新了POM文件,如下所述。在命令提示符處,我運行命令c:\ maven \ bin \ mvn -o test。測試運行良好,構建成功。但報告是HTML格式。你可以請檢查並讓我知道Soapui PRO不會在Allure中顯示報告

<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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.smartbear.soapuiMavenTutorial</groupId> 
    <artifactId>SoapUI-Maven-Tutorial</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>SoapUI-Maven-Tutorial</name> 
    <url>http://maven.apache.org</url> 
    <parent> 
     <groupId>ru.yandex.qatools.allure</groupId> 
     <artifactId>allure-examples-parent</artifactId> 
     <version>1.0</version> 
    </parent> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <aspectj.version>1.8.6</aspectj.version> 
     <allure.version>1.4.14</allure.version> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>ru.yandex.qatools.allure</groupId> 
      <artifactId>allure-maven-plugin</artifactId> 
      <version>2.3-SNAPSHOT</version> 
     </dependency> 
     <!--added jdbc below in build element--> 
    </dependencies> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>SmartBearPluginRepository</id> 
      <url>http://www.soapui.org/repository/maven2/</url> 
     </pluginRepository> 
    </pluginRepositories> 
    <build> 
     <plugins> 
      <plugin> 
       <dependencies> 
        <dependency> 
         <groupId>com.oracle</groupId> 
         <artifactId>ojdbc14</artifactId> 
         <version>10.2.0</version> 
         <scope>runtime</scope> 
         <!--systemPath>C:\maven\ojdbc6.jar</systemPath--> 
        </dependency> 
       </dependencies> 
       <groupId>com.smartbear</groupId> 
       <artifactId>ready-api-maven-plugin</artifactId> 
       <version>1.3.0</version> 
       <executions> 
        <execution> 
         <phase>test</phase> 
         <goals> 
          <goal>test</goal> 
         </goals> 
         <configuration> 
          <projectFile>C:\Gee-SoapUI-Projects-Backup\25Aug2015-POSBkup\May04-2015-Point of Sale.xml</projectFile> 
          <outputFolder>C:\25-Aug-1suiteResults</outputFolder> 
          <reportFormat>xUNIT</reportFormat> 
          <reportName>TestCase Report</reportName> 
          <!--reportName>TestSuite Report</reportName--> 
          <testSuite>ErrorCodes</testSuite> 
          <junitReport>false</junitReport> 
          <printReport>true</printReport> 
          <exportAll>true</exportAll> 
          <soapuiProperties> 
           <property> 
            <name>soapui.home</name> 
            <value>C:\Users\pulipge\ReadyAPI-1.3.0\bin</value> 
           </property> 
          </soapuiProperties> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 
    <reporting> 
     <excludeDefaults>true</excludeDefaults> 
     <plugins> 
      <plugin> 
       <groupId>ru.yandex.qatools.allure</groupId> 
       <artifactId>allure-maven-plugin</artifactId> 
       <version>2.6</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-report-plugin</artifactId> 
       <version>2.18.1</version> 
      </plugin> 
     </plugins> 
    </reporting> 
</project> 

回答

1

傾城maven插件只能在報告部分。在您需要的常規依賴中,您需要

<dependency> 
    <groupId>ru.yandex.qatools.allure</groupId> 
    <artifactId>allure-junit-adaptor</artifactId> 
    <version>${allure.version}</version> 
</dependency> 

改爲。此外,對於高級傾城功能(如附件和測試步驟),您需要配置方面jjava代理 in maven surefire插件

https://github.com/allure-examples/allure-junit-example.git檢查細節。

+0

但是我不知道如果JUnit的適配器適用於這種情況。 SoapUI實際上是一個GUI工具。它會生成JUnit測試嗎? –

0

感謝miheys,Vania。我現在看到魅力報告創建!請參閱attmt。 但它說0 Testsuites,0 Testcases enter image description here 可能是什麼原因。我針對1個測試套件運行了該案例。你能檢查一下嗎?另外我嘗試了allure-junit-adapter,它錯誤地發現它找不到要下載的文件。所以我沒有這樣做。以下是我的POM。

這裏是POM

<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/maven-v4_0_0.xsd"> 

    <modelVersion>4.0.0</modelVersion> 
     <groupId>com.smartbear.soapuiMavenTutorial</groupId> 
    <artifactId>SoapUI-Maven-Tutorial</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>SoapUI-Maven-Tutorial</name> 
    <url>http://maven.apache.org</url> 


     <parent> 
     <groupId>ru.yandex.qatools.allure</groupId> 
     <artifactId>allure-examples-parent</artifactId> 
     <version>1.0</version> 
    </parent> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <aspectj.version>1.8.6</aspectj.version> 
     <allure.version>1.4.14</allure.version> 


    </properties> 



    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
     </dependency> 

      <dependency> 
      <groupId>ru.yandex.qatools.allure</groupId> 
      <artifactId>allure-maven-plugin</artifactId> 
       <version>2.3-SNAPSHOT</version> 
     </dependency> 

<dependency> 
     <groupId>ru.yandex.qatools.allure</groupId> 
     <artifactId>allure-testng-adaptor</artifactId> 
     <version>1.4.14</version> 
    </dependency> 


     <!--Added this junit adaptor--> 
      <!--dependency> 
       <groupId>ru.yandex.qatools.allure</groupId> 
       <artifactId>allure-junit-adaptor</artifactId> 
       <version>2.2</version> 
     </dependency--> 


     <!--added jdbc below in build element--> 
    </dependencies> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>SmartBearPluginRepository</id> 
      <url>http://www.soapui.org/repository/maven2/</url> 
     </pluginRepository> 
    </pluginRepositories> 
    <build> 
     <plugins> 
      <plugin> 
       <dependencies> 
        <dependency> 
         <groupId>com.oracle</groupId> 
         <artifactId>ojdbc14</artifactId> 
         <version>10.2.0</version> 
         <scope>runtime</scope> 
         <!--systemPath>C:\maven\ojdbc6.jar</systemPath--> 
        </dependency> 
       </dependencies> 
       <groupId>com.smartbear</groupId> 
       <artifactId>ready-api-maven-plugin</artifactId> 
       <version>1.3.0</version> 


       <executions> 
        <execution> 
         <phase>test</phase> 
         <goals> 
          <goal>test</goal> 
         </goals> 
         <configuration> 
          <projectFile>C:\Gee-SoapUI-Projects-Backup\25Aug2015-POSBkup\May04-2015-Point of Sale.xml</projectFile> 
          <outputFolder>C:\26-Aug-1suiteResults</outputFolder> 
          <reportFormat>xUNIT</reportFormat> 
          <reportName>TestCase Report</reportName> 
          <!--reportName>TestSuite Report</reportName--> 
          <testSuite>ErrorCodes</testSuite> 
          <junitReport>true</junitReport> 
          <printReport>true</printReport> 
          <exportAll>true</exportAll> 
          <soapuiProperties> 
           <property> 
            <name>soapui.home</name> 
            <value>C:\Users\pulipge\ReadyAPI-1.3.0\bin</value> 
           </property> 
          </soapuiProperties> 

           <properties> 
48       <property> 
49        <name>listener</name> 
50        <value>ru.yandex.qatools.allure.junit.AllureRunListener</value> 
51       </property> 
52      </properties> 


         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

<reporting> 
     <excludeDefaults>true</excludeDefaults> 
     <plugins> 
      <plugin> 
       <groupId>ru.yandex.qatools.allure</groupId> 
       <artifactId>allure-maven-plugin</artifactId> 
       <version>2.7</version> 
      </plugin> 

      <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-report-plugin</artifactId> 
     <version>2.18.1</version> 
     </plugin>   

     </plugins> 
    </reporting>  

</project>