Java自动化测试(jenkins 21)

Wesley13
• 阅读 309

安装jenkins

Jenkins安装

配置Global Tool Configuration

JDK安装

选择本地jdk

maven安装

选择本地maven

Allure Commandline

取个别名

Install automatically自动安装

配置Configure System

Extended E-mail Notification->SMTP server

smtp.163.com

Default user E-mail suffix

@163.com

高级

Use SMTP Authentication

  • 邮箱地址

  • 邮箱授权码

  • use SSL

项目设置

  • 源码管理         svn

  • 构建触发器         Build periodically          定时构建

  • Build            clean test

  • 构建命令

  • 构建后操作

Allure report:result 结果路径

  • Editable Email Notification

  • Project From                        发件人

  • Project Recipient List                收件人

  • 格式:xxxx9@qq.com,xxx@qq.com

  • Attachments                            附件

  • 格式:log/api_auto*.log,src\test\resources\cases_v8.xlsx

*是通配符s

Jenkins邮件 模版

<html><head><meta charset="UTF-8"><title>${PROJECT_NAME}-第${BUILD_NUMBER}次构建日志</title></head><body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"    offset="0">    <table width="95%" cellpadding="0" cellspacing="0"        style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">        <tr>            <td>(本邮件是程序自动下发的,请勿回复!)</td>        </tr>        <tr>            <td><br />            <b><font color="#0B610B">构建信息($BUILD_STATUS)</font></b>            <hr size="2" width="100%" align="center" /></td>        </tr>        <tr>            <td>                <ul>                    <li>项目名称 : ${PROJECT_NAME}</li>                    <li>构建编号 : 第${BUILD_NUMBER}次构建</li>                    <li>触发原因 : ${CAUSE}</li>                    <li>构建日志 : <a href="${BUILD_URL}console">${BUILD_URL}console</a></li>                    <li>工作目录 : <a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li>                    <li>Allure Report : <a href="${BUILD_URL}allure">${BUILD_URL}allure</a></li>                </ul>            </td>        </tr>        <tr>            <td><b><font color="#0B610B">构建日志(最后100行):</font></b>            <hr size="2" width="100%" align="center" /></td>        </tr>        <tr>            <td><textarea cols="80" rows="30" readonly="readonly"                    style="font-family: Courier New">${BUILD_LOG, maxLines=100}</textarea>            </td>        </tr>    </table></body></html>

新建工程

新建

Java自动化测试(jenkins 21)

image-20200818074316555

输入代码路径

Java自动化测试(jenkins 21)

image-20200818074416810

推荐《Jenkins 2.x实践指南》

本文分享自微信公众号 - 测试游记(zx94_11)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
OAM 深入解读:OAM 为云原生应用带来哪些价值?
作者|孙健波(天元) 阿里巴巴技术专家导读:OAM(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzUzNzYxNjAzMg%3D%3D%26mid%3D2247487043%26idx%3D1%26sn%
Wesley13 Wesley13
2年前
Java代码到底是如何编译成机器指令的。
在《Java代码的编译与反编译(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzI3NzE0NjcwMg%3D%3D%26mid%3D2650120609%26idx%3D1%26sn%3D5659f96310963ad57
Wesley13 Wesley13
2年前
VS Code 变身小霸王游戏机!
在韩老师的《VisualStudioCode权威指南》(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzU1NjgwNTExNQ%3D%3D%26mid%3D2247486244%26idx%3D1%26sn%3D98
Wesley13 Wesley13
2年前
JDK14祭出新特性,Lombok要被终结了!
99套Java企业级实战项目(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzAxNDMwMTMwMw%3D%3D%26mid%3D2247494978%26idx%3D1%26sn%3D46ae99739689436a24
Stella981 Stella981
2年前
GitHub iOS 和 Android 正式发布!
推荐阅读:GitHubformobile来了,码农苦逼了!(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzI3ODcxMzQzMw%3D%3D%26mid%3D2247491574%26idx%3D1%26sn%3D
Wesley13 Wesley13
2年前
JDK源码分析
概述前文「JDK源码分析PriorityQueue(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzU4NzYyMDE4MQ%3D%3D%26mid%3D2247483966%26idx%3D1%26sn%3D
Stella981 Stella981
2年前
Python进阶
Python进阶面向对象下(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzUyMDkxNTk1Ng%3D%3D%26mid%3D2247485062%26idx%3D1%26sn%3Db7b94e074000b1d12
Wesley13 Wesley13
2年前
Java 并发编程:如何防止在线程阻塞与唤醒时死锁
Java并发编程:多线程如何实现阻塞与唤醒(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzU3OTc1MDM1Mg%3D%3D%26mid%3D2247494798%26idx%3D1%26sn%3D4b27253ee84
Stella981 Stella981
2年前
Google MapReduce架构设计
前情回顾GoogleMapReduce到底解决什么问题?(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMjM5ODYxMDA5OQ%3D%3D%26mid%3D2651961826%26idx%3D1%26sn