Newman: “htmlextra” reporter not displaying correctly when viewed from Jenkins

Hi,

I am using “htmlextra” to generate a nice report and when I open the html directly it displays correctly.

I have configured Jenkins to use a “Publish HTML Reports” post build action but the display is non-colored and not as nice. I can save the archive locally and open it directly but it would be nice if I could get it to display correctly from Jenkins. It is also displaying at the Job level rather than the build level which is not ideal either.

Has anyone else come across this? Am I using the correct plug-in in Jenkins or is there another plugin?

Thanks in advance!

Hey @mrpatton7,

Welcome to the community :wave:

Thank you for using the reporter!! :trophy:

This is something that might help you out here:

https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy

It’s all down to the way Jenkins is set up by default - I’ve been messing about with this locally and could see the before and after results.

Run this in the Script Console to see the change.

System.setProperty( "hudson.model.DirectoryBrowserSupport.CSP" , "" )

This has multiple security implications so be aware of what you’re doing when unsetting headers like this one.

I was running Jenkins locally so I was in control of the whole set up.

2 Likes

Hey @dannydainton,

It’s so exciting to get a reply from the creator of the reporter :trophy:
Thanks so much for taking the time to look into my problem and get back to me so promptly.
I will look into this tomorrow and let you know how it goes.
Kind regards,
Martin

3 Likes

@dannydainton,

Thanks for quick turnaround .
I really appreciate if you could look into this and help me.

I am not very clear on the approach you have mentioned . Please let me know more specific steps on what i should be doing to get proper HTML report on Jenkins Pipeline.
As per the link below , i tried running : System.setProperty( ‘hudson.model.DirectoryBrowserSupport.CSP’ ,’’ ) this command on console (MAC terminal) which throws error. I don’t see any console on Jenkins > CONFIGURATION

https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy

For me, it was one of the options under Manage Jenkins section (That might not be the actual name)

You run it inside of Jenkins rather than within your Mac terminal.

I’m away at the moment so I can’t give you the actual steps that I took.

I was going to reference this - https://jenkins.io/doc/book/managing/script-console/ but it seems like they haven’t updated the documentation.