HTML page is shown with broken UI While publishing the extent report HTML file using the 'HTML Publisher Plugin', Can any one please guide me how can I print the complete report with proper UI
Screenshot of the report when I open the html report using the HTML publisher plugin
Screenshot of the report when I open the same html report file using the Firefox browser
I was facing a similar issue when I was trying to view the extent report from Jenkins.
Reason for this issue: The issue is because of the 'Content-Security-Policy' which is introduced in Jenkins from v1.641, It is blocking the inline CSS, JS Ajax resources to loaded
Solution: Change default Content Security Policy. Go to Manage Jenkins -> Script Console and type into console the 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 *");
restart Jenkins after the above step
This worked for me :)