生成 HTML TestNG 报告 [英] Generating HTML TestNG reports

查看:42
本文介绍了生成 HTML TestNG 报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成 HTML testNG 报告.默认情况下,我们在运行 testNG 后有一个名为emailable-reports"的报告文件.但现在我想创建自己的 HTML 报告.我尝试使用 ITestListener 和 ITestReport.但即使我覆盖了这些方法,它也没有做任何事情.我不知道如何以及在何处使用这些方法.我有两个测试用例.所以现在我必须把代码放在哪里来生成报告......

I want to generate HTML testNG reports. By default we have a report file after running testNG called "emailable-reports". But now i want to create my own HTML report. I tried to use ITestListener and ITestReport.But even if i override those methods it is not doing any thing. I dono how and where to use those methods. I have two test cases. So now where i have to put the code to produce reports...

推荐答案

@Feanor - 根据您的实现

@Feanor - As per your implementataion

################
  Implementing an instance of IReporter and the generateReport(List<ISuite> suites, String outputDirectory)
#################

我们这里有问题.假设我们已经实现了 Ireporter 的实例说CustomReporter"并覆盖通过在 xml 文件中添加侦听器调用的 generateReport

We have a problem here. Assume we have implemented as instance of Ireporter say "CustomReporter" and override generateReport which gets called by adding listener in xml file

在此 testng 之后还将调用 EmailableReport,它也实现了 Ireporter,它恢复到默认的 testNg 报告

After this testng will ALSO call EmailableReport which also implements Ireporter which reverts back to default testNg report

这篇关于生成 HTML TestNG 报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆