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

相关推荐
Full Stack Developme3 分钟前
SQL 查询中使用 IN 导致性能问题的解决方法
数据库·sql
菜鸟起航ing8 分钟前
【Java面试系列】Spring Boot微服务架构下的分布式事务解决方案与性能优化详解 - 3-5年Java开发必备知识
java·spring boot·微服务·性能优化·分布式事务
小薛博客17 分钟前
架构设计之Redisson分布式锁-可重入同步锁(一)
java·redis·分布式
小开不是小可爱25 分钟前
leetcode_454. 四数相加 II_java
java·数据结构·算法·leetcode
Koma-forever26 分钟前
java设计模式-原型模式
java·设计模式·原型模式
zheshiyangyang31 分钟前
JavaScript---原型和原型链
开发语言·前端·javascript
pumpkin8451436 分钟前
理解 Rust 中的 String 分配机制
开发语言·rust
小宁学技术42 分钟前
MATLAB在工程领域的实际应用案例
开发语言·matlab·matlab实际应用案例·matlab应用案例·matlab 实际应用案例
magic 2451 小时前
MyBatis的缓存、逆向工程、使用PageHelper、使用PageHelper
java·spring·maven·mybatis
神经星星1 小时前
【vLLM 学习】API 客户端
数据库·人工智能·机器学习