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.
Asked
Active
Viewed 8,819 times
3
-
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 Answers
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.

ADHITHYA SRINIVASAN
- 105
- 11
-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
-
Disabling all CSP security is generally not considered a sound "solution" – Ian W May 25 '22 at 08:11