testng查看覆盖率_Eclipse本地使用reportng查看testng运行结果

ReportNG is a

simple HTML reporting plug-in for the TestNG unit-testing framework. It is

intended as a replacement for the default TestNG HTML report. The default

report is comprehensive but is not so easy to understand at-a-glance. ReportNG

provides a simple, colour-coded view of the test results.

reportng是一个简单的testng的生成html格式报告插件,是为了取代testng默认的html report.tesng默认的report不容易理解,也不太美观。reportng提高简单的,多彩的测试结果的视图.

那么问题就来了,怎么使用?

1.首先安装testng plug-in

2.reportng jar和guice jar的配置

注意:是在pom.xml文件中配置

org.uncommons

reportng

1.1.4

test

org.testng

testng

com.google.inject

guice

3.0

test

org.testng

testng

6.9.10

velocity

velocity

1.4

保存后,自动开始下载资源包。

3.查看maven仓库

Maven Dependencies jar是否下载成功。

4.eclipse配置reportng

禁用testng default listeners

在define listener中添加:org.uncommons.reportng.HTMLReporter

最后run as test suite

在test-output>html目录就能看到漂亮的report

如果在ant里使用,需要这样:

haltonfailure="true"

useDefaultListeners="false"

listeners="org.uncommons.reportng.HTMLReporter,org.testng.reporters.FailedReporter">

TestReport"/>

Tips:以上做法方便在本地调试时使用。当你直接拿着@Test类来运行测试用例,eclipse会自动启动默认local的testng-customsuite.xml配置文件,该文件目录一般在(如图):

C:\Users\xx\AppData\Local\Temp\testng-eclipse-1200547509\testng-customsuite.xml

通过上述配置后,查看test-output文件下index.html会显示出来Reportng-Result。

但是,当你需要使用服务器来跑tesng.xml文件时,使用reportng做报告输出;那就需要通过解

析你目录下写的testng.xml和另外的配置了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值