jenkins生成html报告

jenkin构建完毕,根据构建过程有自动化测试,测试生成报告在浏览器打开预览

插件

  • HTML Publisher(build reports)

解决html展示权限问题

  • m1: 通过执行脚本(临时有效,重启jenkins就失效)
jenkins管理—>脚本执行
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP"," ")

再次构建,打开html查看

  • m2: 安装groovy及插件
add build step -> execute Groovyscript
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP"," ")

归档报告

构建完毕后-> publish html reports

  • 1.HTML directory to archive:测试报告的路径,相对于工作空间

  • 2.Index pages
    *.html:获取该路径下所有的html文件,为了测试报告正确,保证工作空间只有最新生成的测试报告

  • 3.Index page titles:非必填项

  • 4.Report title:测试报告名称

  • 5.存之后需要立即构建,然后面板上就会出现html的按钮