问题描述
显示的HTML页面UI损坏当使用"HTML Publisher插件"发布范围报告HTML文件时,任何人都可以指导我如何使用正确的UI打印完整的报告
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
使用HTML发布者插件打开html报告时的报告截图
当我使用Firefox浏览器打开相同的html报告文件时的报告截图
推荐答案
当我尝试查看Jenkins的范围报告时,我遇到了类似的问题.
I was facing a similar issue when I was trying to view the extent report from Jenkins.
此问题的原因:问题是由于Jenkins从v1.641开始引入的"Content-Security-Policy",它阻止了内联CSS,JS Ajax资源的加载
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
解决方案:更改默认的内容安全策略.转到管理Jenkins"->脚本控制台",然后在控制台中键入以下命令:
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 *");
完成上述步骤后,重新启动Jenkins
restart Jenkins after the above step
这对我有用:)
这篇关于HTML页面显示为损坏的UI,同时使用"HTML Publisher Plugin"在Jenkins上发布范围报告HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!