使用 Jenkins 显示自定义 HTML 或 XML 报告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28085207/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Displaying custom HTML or XML reports with Jenkins
提问by PrathamN
I have generated custom XML reports through testing. is it possible to display these XML with Jenkins? If possible, then how to display it with Jenkins?
我通过测试生成了自定义 XML 报告。是否可以使用 Jenkins 显示这些 XML?如果可能,那么如何用Jenkins展示它?
回答by Joachim Nilsson
If it is a homebrewed XML, I would suggest that you first convert it to HTML then use the HTML Publisher Plugin
如果是自制的 XML,我建议您先将其转换为 HTML,然后使用 HTML Publisher Plugin
https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin
Otherwise, mark it as a build artifact and allow users to download it from the Jenkins job.
否则,将其标记为构建工件并允许用户从 Jenkins 作业下载它。
回答by Eyal Sooliman
First you have to:
首先你必须:
- Configure listeners in your testNg.xml file.
- Write the listeners classes.
- 在 testNg.xml 文件中配置侦听器。
- 编写监听器类。
Then, configure Jenkins to show the custom report after your builds:
然后,配置 Jenkins 以在构建后显示自定义报告:
- Go to "Post-build Actions" -> Choose "publish html reports".
- Add your directory where the custom report is, for example: /test-output
- Add the index file under Index page[s], for example: custom-report.html
- 转到“构建后操作”-> 选择“发布 html 报告”。
- 添加自定义报告所在的目录,例如:/test-output
- 在Index page[s]下添加index文件,例如:custom-report.html
Run your build an see your custom html report on Jenkins.
运行您的构建并在 Jenkins 上查看您的自定义 html 报告。
回答by QA Automation tester
Install HTMLPublisher plugin in Jenkins and after that perform the steps mentioned by Eyal
在 Jenkins 中安装 HTMLPublisher 插件,然后执行 Eyal 提到的步骤
回答by Fakrudeen
There is this summary display plugin as well: https://wiki.jenkins.io/display/JENKINS/Summary+Display+Plugin
还有这个摘要显示插件:https: //wiki.jenkins.io/display/JENKINS/Summary+Display+Plugin


