io.qameta.allure
allure-testng
2.12.1
test
org.apache.maven.plugins
maven-surefire-plugin
2.22.1
true
testng.xml
-Dfile.encoding=UTF-8
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar"
allure.results.directory
${project.build.directory}/allure-results
org.aspectj
aspectjweaver
1.9.2
FileInputStream 从文件系统中的某个文件中获得输入字节。
文件输出流是用于将数据写入到文件中。
PrintStream fileOutPutStream = new PrintStream(new File("log/testXX.log"));
RestAssured.config =
RestAssured.config().logConfig(LogConfig.logConfig().defaultStream(fileOutPutStream));
Allure.addAttachment("接口请求响应信息",new FileInputStream("日志文件的路径"));
mvn test
注意:要生成Allure的报表,必须要通过mvn test去执行,不能直接在测试类中右键执行或者右键执行TestNG.xml
mvn io.qameta.allure:allure-maven:serve