allure2 report+ jenkins 使用


物色了一個挺漂亮的報告生成插件 ——allure。

下面介紹一下這個報告的使用。

 

1. 添加依賴

 

 1 <dependencies>  
 2 <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-testng -->
 3         <dependency>
 4             <groupId>io.qameta.allure</groupId>
 5             <artifactId>allure-testng</artifactId>
 6             <version>2.6.0</version>
 7         </dependency>
 8 </dependencies>
 9 
10 <build>
11         <plugins>
12             <plugin>
13                 <groupId>org.apache.maven.plugins</groupId>
14                 <artifactId>maven-surefire-plugin</artifactId>
15                 <version>2.20.1</version>
16                 <configuration>
17                     <systemPropertyVariables>
18                         <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
19                     </systemPropertyVariables>
20                     <testFailureIgnore>true</testFailureIgnore>
21                     <argLine>-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"23                     </argLine>
24                     <suiteXmlFiles>
25                         <suiteXmlFile>testng.xml</suiteXmlFile>
26                     </suiteXmlFiles>
27                 </configuration>
28                 <dependencies>
29                     <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
30                     <dependency>
31                         <groupId>org.aspectj</groupId>
32                         <artifactId>aspectjweaver</artifactId>
33                         <version>${aspectj.version}</version>
34                     </dependency>
35                 </dependencies>
36             </plugin>
37           <plugins>
38    <build>         

 

 

在jenkins中搜索安裝allure-report插件

 

登錄jenkins ——系統設置——管理插件。

在過濾中輸入allure

我安裝的2.26版本。

 

到構建項目中的配置中。

 

 

在全局工具配置添加Allure Commandline

 

 

 

構建后出來的報告:

附上allure2 框架使用文檔

https://docs.qameta.io/allure/2.0/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM