官网文档:
https://docs.qameta.io/allure/#_testng
官网文档: https://docs.qameta.io/allure/#_testng 5.3. TestNG 5.3.1. Installation The available latest version of allure-testng: Maven You need to add the following to your pom.xml: pom.xml <properties> <aspectj.version>1.8.10</aspectj.version></properties> <dependencies> <dependency> <groupId>io.qameta.allure</groupId> <artifactId>allure-testng</artifactId> <version>LAST_VERSION</version> <scope>test</scope> </dependency></dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.20</version> <configuration> <argLine> -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" </argLine> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> </dependencies> </plugin> </plugins></build> Then run the build as usual: $ mvn clean test Allure results will appear in target/allure-results folder. To generate html report and automatically open it in a web browser, run the following command: $ allure serve target/allure-results |