设为首页 收藏本站
查看: 1078|回复: 0

[经验分享] Jenkins上配置Robot Framework测试邮件通知模板

[复制链接]

尚未签到

发表于 2018-1-9 21:11:57 | 显示全部楼层 |阅读模式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  <style type="text/css">
  /*base css*/
  a{color:#4a72af}
  body{background-color:#e4e4e4}
  body,p{margin:0;padding:0}
  img{display:block}
  h1,h2,h3,h4,h5,h6{margin:0 0 .8em 0}
  h3{font-size:28px;color:#444!important;font-family:Arial,Helvetica,sans-serif}
  h4{font-size:22px;color:#4a72af!important;font-family:Arial,Helvetica,sans-serif}
  h5{font-size:18px;color:#444!important;font-family:Arial,Helvetica,sans-serif}
  p{font-size:12px;color:#444!important;font-family:"Lucida Grande","Lucida Sans","Lucida Sans Unicode",sans-serif;line-height:1.5}
  table.robotstat {
  border: 1px solid black;
  border-collapse: collapse;
  empty-cells: show;
  margin: 0px 1px;
  table-layout: fixed;
  word-wrap: break-word;
  font-size: 1em;
  border-width:1px;
  }
  tr.test_column_robot {
  background-color:#C6C6C6;
  }
  ol li img{display:inline;height:20px}
  /*div styles*/
  .news{text-align:center;padding-top:15px;}
  .content{width:720px;margin:0 auto;background-color:white}
  .round_border{margin-bottom:5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;margin-top:0;font-size:14px;padding:6px;border:1px solid #ccc}
  .status{background-color:<%=
  build.result.toString() == "SUCCESS" ? 'green' : 'red' %>;font-size:28px;font-weight:bold;color:white;width:720px;height:52px;margin-bottom:18px;text-align:center;vertical-align:middle;border-collapse:collapse;background-repeat:no-repeat}
  .status .info{color:white!important;text-shadow:0 -1px 0 rgba(0,0,0,0.3);font-size:32px;line-height:36px;padding:8px 0}
  .main img{width:38px;margin-right:16px;height:38px}
  .main table{font-size:14px;}
  .main table th{text-align:right;}
  .bottom-message{width:720px;cellpadding:5px;cellspacing:0px}
  .bottom-message .message{font-size:13px;color:#aaa;line-height:18px;text-align:center}
  .bottom-message .designed{font-size:13px;color:#aaa;line-height:18px;font-style: italic;text-align:right}
  img.cartoon {width: 36px; display:inline}
  </style>
  <body>
  <div>
  <div>
  <p>构建状态 <%= build.result.toString().toLowerCase() %></p>
  </div>
  <!-- status -->
  <div>
  <table>
  <tbody>
  <tr>
  <th>项目名称:</th>
  <td>${project.name}</td>
  </tr>
  <tr>
  <th>构建轮次:</th>
  <td><a
  href="${rooturl}${build.url}">${build.displayName}(点击查看此轮构建信息)</a></td>
  </tr>
  <tr>
  <th>构建时间:</th>
  <td>${it.timestampString}</td>
  </tr>
  <tr>
  <th>构建时长:</th>
  <td>${build.durationString}</td>
  </tr>
  <tr>
  <th>构建缘由:</th>
  <td><% build.causes.each() { cause -> %> ${cause.shortDescription} <% } %></td>
  </tr>
  <tr>
  <th>测试报告:</th>
  <td><a
  href="${rooturl}${build.url}robot">点击查看测试报告详情</a></td>
  </tr>
  <tr>
  <!-- test stat -->
  <th>测试统计:</th></br>
  <td>
  <table>
  <thead>
  <tr>
  <th>测试总用例数</th>
  <th>失败用例数</th>
  <th>测试通过率</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <%  def robotTestResultAction = it.getAction("hudson.plugins.robot.RobotBuildAction") %>
  <td>${robotTestResultAction.getTotalCount()}</td>
  <td>${robotTestResultAction.getFailCount()}</td>
  <td>${robotTestResultAction.getOverallPassPercentage()}%</td>
  </tr>
  </tbody>
  </table>
  </td>
  </tr>
  <tr>
  <th>变更记录:</th>
  <td><a
  href="${rooturl}${build.url}changes">点击查看变更记录</a></td>
  </tr>
  <tr>
  <td colspan="2"> </td>
  </tr>
  </tbody>
  </table>
  </div>
  <!-- main -->
  <% def artifacts = build.artifacts
  if(artifacts != null && artifacts.size() > 0) { %>
  <div>
  <b>Build Artifacts:</b>
  <ul>
  <%         artifacts.each() { f -> %>
  <li><a href="${rooturl}${build.url}artifact/${f}">${f}</a></li>
  <%        } %>
  </ul>
  </div>
  <% } %>
  <!-- artifacts -->
  <% def changeSet = build.changeSet
  if(changeSet != null) {
  def hadChanges = false
  def count = 0 %>
  <div>
  <b>变更详细:</b>
  <ol>
  <%     changeSet.each() { cs ->
  hadChanges = true
  def aUser = cs.author %>
  <li>${cs.msgAnnotated} (${aUser.displayName})
  (<a href="${rooturl}${build.url}changes#detail${count}">detail</a>)</li>
  <%      count ++
  }  %>
  </ol>
  </div>
  <% } %>
  <!-- details -->
  </div>
  <!-- content -->
  <table align="center">
  <tr>
  <td>You are receiving this email because you

  are>  </td>
  </tr>
  <tr>
  <td colspan="2">designed by @wangyang  </td>
  </tr>
  </table>
  <!-- bottom message -->
  </body>

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-433367-1-1.html 上篇帖子: jenkins-pipeline 自动部署后端的测试环境 下篇帖子: Linux 环境下搭建 Jenkins(Hudson)平台
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表