一、先引入三个依赖包
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.1</version>
</dependency>
<dependency>
<groupId>com.vimalselvam</groupId>
<artifactId>testng-extentsreport</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.0.6</version>
</dependency>
二、然后编写监听类,监听测试执行过程中哪些测试成功,哪些失败,写入报告中
https://download.csdn.net/download/qq_30353203/10626913
三、在xml文件中填写监听
<listener class-name="com.demo.test.plugins.arrow.ExtentTestNGIReporterListener" />
四、运行test后会出报告