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文件

相关推荐
Coding小公仔几秒前
LeetCode 151. 反转字符串中的单词
开发语言·c++·算法
程序猿阿伟2 分钟前
《声音的变形记:Web Audio API的实时特效法则》
开发语言·前端·php
东阳马生架构4 分钟前
订单初版—2.生单链路中的技术问题说明文档
java
咖啡啡不加糖19 分钟前
暴力破解漏洞与命令执行漏洞
java·后端·web安全
风象南22 分钟前
SpringBoot敏感配置项加密与解密实战
java·spring boot·后端
九皇叔叔31 分钟前
【7】PostgreSQL 事务
数据库·postgresql
DKPT32 分钟前
Java享元模式实现方式与应用场景分析
java·笔记·学习·设计模式·享元模式
kk在加油34 分钟前
Mysql锁机制与优化实践以及MVCC底层原理剖析
数据库·sql·mysql
小爱同学ya40 分钟前
【效率提升教程】飞书自动化上传图片和文字
自动化·飞书
Percep_gan40 分钟前
idea的使用小技巧,个人向
java·ide·intellij-idea