服务器上搭建考试系统,服务器上搭建Jenkins完成自动化测试(二)

开始配置Jenkins了,脚本用TestNG+Java+Selenium

1、输入网址,登陆Jenkins

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

2、系统设置

2.1下载插件

点击"系统管理-管理插件",进入到插件管理界面,点击“可选插件”

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

搜索"testng"

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

点击“立即安装”

搜索“HTML Publisher plugin”

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

点击“立即安装”

安装“Email Extension Plugin”

如果以上插件没有搜索到,可以看一下“已安装”插件内

2.2 设置JDK 、Ant

一般可以选择“系统管理”--“系统设置”可以找到如下界面

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

由于我安装的版本是2.78,在“系统设置”里没有这两项转移到“系统管理”--“Global Tool Configuration”里了

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

别名:随表叫,当然叫蓝洁灵都没人管你(最好叫个规范点的,以后自己也知道。)

JAVA_HOME:写在服务器配置时填写的JAVA_HOME

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

Ant的配置和JDK一样,

ANT_HOME:写在服务器配置时填写的ANT_HOME

3、配置项目环境

3.1

点击“新建”,随便输个项目名称,选择“构建一个自由风格的软件项目”

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

点击“ok”按钮,进入下边的界面

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

3.2

随便写个项目描述

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

选择“丢弃旧构建”,因为以后要做回归测试,每次都要保存构建内容的话,可能要占用一定的磁盘空间,天数根据需求活业务情况写

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

我写的是“5”,说明超过30天的构建就不要了,如果填写构建的最大个数是100,说明超过100轮的构建就不要了

3.3

源码管理

配置SVN,Repository URL填写项目源码放在SVN的位置

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

为了后面构建成功,点击Repository URL后的“?”进行强制认证一下,点击“this link”

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

输入Repository URL,username,password。点击“ok”,提示认证成功

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

认证成功

3.4

构建触发器,是指源码满足什么条件时触发

选择Build periodically,设置日程表。下图的意思是,每天晚上9点开始运行

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

关于日程表的规则

MINUTE Minutes within the hour (0–59)

HOUR The hour of the day (0–23)

DOM The day of the month (1–31)

MONTH The month (1–12)

DOW The day of the week (0–7) where 0 and 7 are Sunday.

To specify multiple values for one field, the following operators are available. In the order of precedence,

* specifies all valid values

M-N specifies a range of values

M-N/X or */X steps by intervals of X through the specified range or whole valid range

A,B,...,Z enumerates multiple values

Examples:

# every fifteen minutes (perhaps at :07, :22, :37, :52)

H/15 * * * *

# every ten minutes in the first half of every hour (three times, perhaps at :04, :14, :24)

H(0-29)/10 * * * *

# once every two hours at 45 minutes past the hour starting at 9:45 AM and finishing at 3:45 PM every weekday.

45 9-16/2 * * 1-5

# once in every two hours slot between 9 AM and 5 PM every weekday (perhaps at 10:38 AM, 12:38 PM, 2:38 PM, 4:38 PM)

H H(9-16)/2 * * 1-5

# once a day on the 1st and 15th of every month except December

H H 1,15 1-11 *

3.5

构建环境,勾选“With Ant"

构建,点击”增加构建步骤“选择”Invoke Ant",选择构建的ant

512317eac26a?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

3.6

构建后操作,是指在构建后需要输出测试报告,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值