有没有办法为 NUnit3 创建 HTML 报告? [英] Are there any ways to create HTML report for NUnit3?

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

问题描述

我看到了 NUnit 2.x 版本的几个解决方案.例如,我可以创建 XSLT,或者使用 Allure Reporter.

I saw several solutions for NUnit 2.x version. For example, I can create XSLT, or use Allure Reporter.

但是如何为 NUnit 3.x 版本执行此操作(无需为 NUnit XML 结果编写自己的 XSLT)?

But how can I do it for NUnit 3.x version (without writing my own XSLT for NUnit XML results)?

Allure 不适用于 NUnit3.

Allure does not work with NUnit3.

推荐答案

我建议使用 GHPReporter.您可以为 NUnit 3、SpecFlow 和 MSTest 创建报告.

I would suggest using GHPReporter. You can create reports for NUnit 3, SpecFlow and MSTest.

NUnit 3 不需要其他属性.只需设置插件(请参阅自述文件中的简短说明:https://github.com/GHPReporter/Ghpr.NUnit) 并使用 NUnit3 控制台运行您的测试.

No additional attributes required for NUnit 3. Just set up addin (see short instruction in README file: https://github.com/GHPReporter/Ghpr.NUnit) and run your tests with NUnit3 Console.

在 Firefox 中本地查看您的报告:

View your report locally in Firefox:

  • 转到about:config
  • 查找security.fileuri.strict_origin_policy 参数
  • 设置为false

在 Chrome 中本地查看您的报告:

View your report locally in Chrome:

  • 关闭 Chrome(所有实例)
  • 使用 --allow-file-access-from-files 选项启动它:例如 C:\PATH TO\chrome.exe --allow-file-access-from-files
  • Close your Chrome (all instances)
  • Launch it with --allow-file-access-from-files option: eg C:\PATH TO\chrome.exe --allow-file-access-from-files

另见演示报告这里

已编辑

NUnitGo 不再维护.

这篇关于有没有办法为 NUnit3 创建 HTML 报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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