3

I am using HTML publisher plugin in Jenkins, and generating opening Extent Report. By Report generated with Jenkin don't have UI. However when I open then manually they opens just fine.

Click of Report Snapshot

Craig
  • 7,471
  • 4
  • 29
  • 46
Vaibhav
  • 143
  • 1
  • 6
  • 14
  • You will find solution on github extent reports https://github.com/anshooarora/extentreports/issues/290 – Karthik Jan 28 '16 at 21:46
  • Also here. http://stackoverflow.com/questions/34892106/html-page-is-shown-with-broken-ui-while-publishing-the-extent-report-html-file-u – Karthik Jan 28 '16 at 21:47
  • Detailed explanation: https://kb.froglogic.com/display/KB/Content+Security+Policy+(CSP)+for+Web+Report – Vladimir Grigorov Jul 14 '17 at 14:19

3 Answers3

4

To change default Content Security Policy go to Manage Jenkins -> Script Console and add following commands:

System.clearProperty("hudson.model.DirectoryBrowserSupport.CSP");

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src 'self'; script-src * 'unsafe-eval'; img-src *; style-src * 'unsafe-inline'; font-src *");

Run the Build and View the report.

Diptman
  • 374
  • 3
  • 14
Charu Jain
  • 91
  • 1
  • 3
  • This fixed it for me (source https://kb.froglogic.com/display/KB/Content+Security+Policy+(CSP)+for+Web+Report): System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-same-origin allow-scripts; default-src 'self'; script-src * 'unsafe-eval'; img-src *; style-src * 'unsafe-inline'; font-src *"); – Vladimir Grigorov Jul 14 '17 at 14:18
0

Point out the extent report file (For example, Report.html) in the index page field and the extent report directory in the HTML Directory to archive field in the html publisher plugin configuration.

-1

Go to Manage Jenkins then to Script Console and paste this code:

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

Then click run.

Now, rerun your build and check again. You should be able to see the UI of the report now

Gryu
  • 2,102
  • 2
  • 16
  • 29
mbn217
  • 884
  • 7
  • 14