java接口自动化系列(12):集成allure报告

本系列汇总,请查看这里https://www.cnblogs.com/uncleyong/p/15867903.html

pom添加依赖、属性、插件

依赖

复制代码
        <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-testng -->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-testng</artifactId>
            <version>2.8.1</version>
        </dependency>

属性、插件

复制代码
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aspectj.version>1.8.10</aspectj.version>
    </properties>
 
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <suiteXmlFiles>
                        <suiteXmlFile>testngXML/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
 
                    <properties>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                    </properties>
                    <workingDirectory>/</workingDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

结果演示

运行testng.xml,生成了allure-results文件夹

文件夹内容是一堆json文件

相关推荐
zhangchaoxies26 分钟前
如何在 Go 中安全复制接口指针所指向的值
jvm·数据库·python
Halo_tjn39 分钟前
Java 基于字符串相关知识点
java·开发语言·算法
梦想的颜色44 分钟前
java 利用redis来限制用户频繁点击
java·开发语言
报错小能手1 小时前
Swift 并发 Combine响应式框架
开发语言·ios·swift
陈陈CHENCHEN1 小时前
【数据库】MySQL 8.0.40 至 8.0.44 RPM 方式升级指南
数据库·mysql
万法若空1 小时前
C++ <memory> 库全方位详解
开发语言·c++
代码中介商1 小时前
C++ 类型转换深度解析:static_cast、dynamic_cast、const_cast、reinterpret_cast
开发语言·c++
Azhao11061 小时前
一文读懂分享网站模块介绍(附实操教程)
mysql
青小莫1 小时前
C++之string(OJ练习)
开发语言·c++·stl
freshman_y1 小时前
一篇介绍C语言中二级指针和二维数组的文章
c语言·开发语言