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

相关推荐
二哈喇子!1 分钟前
MySQL数据更新操作
数据库·sql
二哈喇子!2 分钟前
MySQL命令行导入数据库
数据库·sql·mysql·vs code
二哈喇子!5 分钟前
空指针异常
开发语言
心动啊1217 分钟前
SQLAlchemy 的使用
数据库
强子感冒了10 分钟前
Java网络编程学习笔记,从网络编程三要素到TCP/UDP协议
java·网络·学习
咚为11 分钟前
Rust Print 终极指南:从底层原理到全场景实战
开发语言·后端·rust
二哈喇子!12 分钟前
SpringBoot项目右上角选择ProjectNameApplication的配置
java·spring boot
%xiao Q16 分钟前
GESP C++五级-202406
android·开发语言·c++
Psycho_MrZhang16 分钟前
Neo4j Python SDK手册
开发语言·python·neo4j
Traced back23 分钟前
# C# + SQL Server 实现自动清理功能的完整方案:按数量与按日期双模式
开发语言·c#