简体   繁体   English

pytest html 报告未在 jenkins 中以 html 格式显示

[英]Pytest html report is not showing in html format in jenkins

If i do the execution in local we can see the report in html format.如果我在本地执行,我们可以看到 html 格式的报告。 Even if we do the execution through jenkins it is generation in html format only.即使我们通过 jenkins 执行它也只是以 html 格式生成。

But for viewing it is not shwoing as expected.但是对于观看它并没有像预期的那样显示。

Please find the below diffferences for both.请找到以下两者的差异。

if i open jenkins report by downloading it is opening normally like how we are seeing manual execution report.如果我通过下载打开 jenkins 报告,它会像我们看到的手动执行报告一样正常打开。 If i try to open this from jenkins then we are getting below issue.如果我尝试从 jenkins 打开它,那么我们就会遇到以下问题。

Jenkins report詹金斯报告

詹金斯执行报告 Locan execution report本地执行报告

本地执行报告

have similar problem This happens because of 'Content-Security-Policy' of Jenkins is blocking the inline CSS, JS Ajax resources to load有类似的问题发生这种情况是因为 Jenkins 的“Content-Security-Policy”阻止了内联 CSS、JS Ajax 资源的加载

The solution to this is start Jenkins server with below command解决方案是使用以下命令启动 Jenkins 服务器

java -Dhudson.model.DirectoryBrowserSupport.CSP="" -jar jenkins.war

在此处输入图片说明

more you can read here更多你可以在这里阅读

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM