Idea+maven+testng+reportng生成测试报告
TestNG自带的测试报告不是很好用,所以一般结合reportng生成美观的测试报告。
首先,在pom.xml中添加testng和reportng相关依赖
<dependencies>
<!-- 添加testNG依赖 -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>test</scope>
</dependency>
<!-- 添加reportNG依赖 -->
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.2</version>
<scope>test</scope>
<!-- 排除testNG依赖 -->
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
pom.xml中配置maven-surefire-plugin并加入reportng listener
<properties>
<xmlFileName>testng.xml</xmlFileName>
</properties> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<skipTests>false</skipTests>
<suiteXmlFiles>
<suiteXmlFile>${xmlFileName}</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<forkMode>always</forkMode>
</configuration>
</plugin>
</plugins>
</build>
在testng.xml中<suite>标签加入listener
<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter"/>
<listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>
</listeners>
在Idea中打开Run-Edit Configurations...

在Listeners标签下勾选“Use default reporters”

最后运行testng.xml,自动生成test-output目录,在html目录下找到index.html

打开index.html

Idea+maven+testng+reportng生成测试报告的更多相关文章
- Mac Eclipse+Maven+TestNg+ReportNg 生成测试报告
TestNG 是java 的单元测试框架,功能很强大,很方便,但是自动生成的测试报告有待改善,可以使用TestNg 自带的TestNG_xslt更改TestNG报告的样式,这里主要讲解ReportNg ...
- Eclipse+Maven+TestNg+ReportNg 生成测试报告
http://blog.csdn.net/a542551042/article/details/46729585
- TestNG之使用ReportNG生成测试报告
TestNG使用ReportNG生成测试报告会更加美观. 依赖包 <!--testNG报告依赖包--> <dependency> <groupId>org.test ...
- Appium+Maven+TestNG(ReportNG)环境搭建(详细过程)
最近群里经常有人会问到关于maven构建Appium测试项目以及使用testNG生成测试报告的问题,试着搭建了一下,下面是过程: jdk安装过程我这里就不说了 一.下载eclipse,推荐下载Ecli ...
- Maven+TestNG+ReportNG/Allure接口自动化测试框架初探(上)
转载:http://www.51testing.com/html/58/n-3721258.html 由于一直忙于功能和性能测试,接口自动化测试框架改造的工作被耽搁了好久.近期闲暇一些,可以来做点有意 ...
- CentOS下搭建自动化测试基础框架:Jenkins+Maven+TestNG+ReportNG
1. 安装JDK 1.1 卸载系统默认已安装的open-jdk rpm -qa|grep java 查出来openjdk相关的应用,把查出来的所有都要通过下面的命令给卸载掉 rpm -e --node ...
- maven+testng+reportng的pom设置
在pom.xml 加入: <dependency> <groupId>org.testng</groupId> <artifactId>testng&l ...
- TestNG+ReportNG+Maven优化测试报告
转载:https://www.cnblogs.com/hardy-test/p/5354733.html 首先在eclipse里面创建一个maven项目,具体要配置maven环境,请自行百度搭配环境. ...
- testng生成报告ReportNG美化测试报告
testng生成报告ReportNG美化测试报告 testng生成报告ReportNG美化测试报告 ReportNG 是一个配合TestNG运行case后自动帮你在test-output文件内生成一个 ...
随机推荐
- HDU 5855Less Time, More profit
Less Time, More profit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/O ...
- SQl 事物+视图+游标+索引+锁
一:事务: 是访问并可能更新数据库中各种数据项的一个程序执行单元(unit),事务是恢复和并发控制的基本单位. 事务的四个特性:ACID A:atomicity 原子性,事务里的所有操作都是一体的,要 ...
- 2018GDKOI游记
我很后悔DAY1考完就写了小结.没人看题解,却这么多人来揭我伤疤.既然明摆着摆出来就是刷访问量,下面的就别看了吧. --------------------分割线------------------- ...
- YTU 2631: B1 能存各种类型数据的Store类
2631: B1 能存各种类型数据的Store类 时间限制: 1 Sec 内存限制: 128 MB 提交: 245 解决: 177 题目描述 有一种类,海纳百川,可以对任意类型的数据进行存取,造就 ...
- Linux 常用命令大全2
Linux 常用命令大全 [帮助命令] command —help man command man 2 command 查看第2个帮助文件 man -k keyword 查找含有关键字的帮助 info ...
- python-----删除文件到回收站
python删除文件一般使用os.remove,但这样删是直接删除文件,不删到回收站的,那么想删除文件到回收站怎么办? 这时,就需要使用shell模块了 from win32com.shell imp ...
- POJ1265 Area 多边形内格点数 Pick公式
POJ1265给定一个多边形 计算边上的格点 内部的格点 以及多边形的面积 利用Pick公式 面积=内部格点数+边上格点数/2-1 将多边形分割为三角形容易证得上述公式 计算面积用叉积,计算边上格点 ...
- 引水入城 2010年NOIP全国联赛提高组(bfs+贪心)
1066 引水入城 2010年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond 题目描述 Description 在一个遥远 ...
- 转载使用 ContentObsever 拦截短信,获取短信内容
在一些应用上,比如手机银行,QQ,微信等,很多时候我们都需要通过发送验证码到手机上,然后把验证码填上去,然后才能成功地继续去做下面一步事情. 而如果每次我们都要离开当前界面,然后去查收短信,记住验证码 ...
- ACM_走楼梯Ⅱ
走楼梯Ⅱ Time Limit: 2000/1000ms (Java/Others) Problem Description: 有一楼梯共N+1级,刚开始时你在第一级,若每次能走M级(1<=M& ...