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/

猜你喜欢

转载自www.cnblogs.com/mh1213/p/9379803.html