首先配置maven和allure环境 -- 略
环境可能遇到问题见:
点击查看在pom.xml文件中引入扫描build标签:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.1</version> <configuration> <skipTests>false</skipTests> <!--表示执行任何子目录下所有命名以Test结尾的java类 --> <includes> <include>**/*Test.java</include> </includes> <!--表示不执行任何子目录下所有命名以Test开头的java类 --> <excludes> <exclude>**/Test*.java</exclude> </excludes> <testFailureIgnore>true</testFailureIgnore> <argLine> -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar" </argLine> <properties> <property> <name>listener</name> <value>io.qameta.allure.junit4.AllureJunit4</value> </property> </properties> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.9.5</version> </dependency> </dependencies> </plugin> </plugins> </build>
随便写两个测试类:
使用命令:
mvn test
生成数据
然后使用
allure generate ./allure-results -o ./fileresult --clean
生成报告:
标签:plugin,idea,1.9,maven,allure,使用,org,aspectjweaver From: https://www.cnblogs.com/0099-ymsml/p/17728013.html