美文网首页Robot Framework测试框架
解决从jenkins打开robot framework报告会提示

解决从jenkins打开robot framework报告会提示

作者: _初七hehe | 来源:发表于2017-03-24 13:30 被阅读444次

    一、在使用robot framework plugin与jenkins做持续集成,执行自动化测试脚本的时候,会出现以下提示。

    之前,用的还好好的,为什么现在的报告(reporter.html,log.html)打不开了呢?

    出现这个问题的原因是:你升级了jenkins造成的。据官方说明:

    Jenkins 1.641 / Jenkins 1.625.3 introduce the Content-Security-Policy header to static files served by Jenkins (specifically, DirectoryBrowserSupport). This header is set to a very restrictive default set of permissions to protect Jenkins users from malicious HTML/JS files in workspaces, /userContent, or archived artifacts.

    jenkins增加的内容安全策略,默认情况下,是禁止执行javascript,css等资源的。

    那么如何解决呢?

    找到jenkins的安装目录下的jenkins.xml,修改此文件

    修改前

    -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar"%BASE%\jenkins.war"--httpPort=8080

    修改后

    -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' 'unsafe-inline';"-jar"%BASE%\jenkins.war"--httpPort=8080

    一定要重启jenkins,最好能再执行一下测试脚本,让它生成新的报告文件就行了。

    参考链接:

    https://groups.google.com/forum/#!msg/concordion/RSp92D2CNuc/nwYW4yqvEQAJ

    https://kb.froglogic.com/display/KB/Content+Security+Policy+(CSP)+for+Web+Report

    http://www.tuicool.com/articles/EruURz

    二、发送出来的邮件含有网址,网址打不开的情况

    解决方法如下:

    1、系统管理-系统设置-更改Jenkins location栏

    相关文章

      网友评论

      • 纳爱斯:你好 请教个问题,请问 jenkins.xml 这个文件在哪,我是在 ubuntu 中安装的 Jenkins 在 Jenkins 的根目录下没找到这个文件

      本文标题:解决从jenkins打开robot framework报告会提示

      本文链接:https://www.haomeiwen.com/subject/xxqfottx.html