PrathamN
PrathamN

Reputation: 194

Displaying custom HTML or XML reports with Jenkins

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?

Upvotes: 7

Views: 54334

Answers (5)

Moshe
Moshe

Reputation: 5129

Badge plugin

Usage in a pipeline:

def icon = "info.gif"
createSummary(
  icon: icon,
  text: """<h1>My Custom Summary</h1>"""
)

Upvotes: 0

user256717
user256717

Reputation:

There is this summary display plugin as well: https://wiki.jenkins.io/display/JENKINS/Summary+Display+Plugin

Sample summary display from XML

Upvotes: 1

QA Automation tester
QA Automation tester

Reputation: 31

Install HTMLPublisher plugin in Jenkins and after that perform the steps mentioned by Eyal

Upvotes: 2

Eyal Sooliman
Eyal Sooliman

Reputation: 2248

First you have to:

  1. Configure listeners in your testNg.xml file.
  2. Write the listeners classes.

Then, configure Jenkins to show the custom report after your builds:

  1. Go to "Post-build Actions" -> Choose "publish html reports".
  2. Add your directory where the custom report is, for example: /test-output
  3. Add the index file under Index page[s], for example: custom-report.html

Run your build an see your custom html report on Jenkins.

Upvotes: 3

Jocce Nilsson
Jocce Nilsson

Reputation: 1748

If it is a homebrewed XML, I would suggest that you first convert it to HTML then use the 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.

Upvotes: 4

Related Questions