linux+jenkins+postman持续集成

环境搭建:linux上安装newman,部署好jenkins linux上war包方式安装Jenkins

以下实现jenkins上执行postman测试脚本:

1.新建一个自动风格的job

2.构建-增加构建步骤-执行shell

source /etc/profile

cd /home/postman_script
newman run v3.x审方-0-用户登录和开始审方.postman_collection.json -e 10.1.1.71.postman_environment.json --reporters cli,json,html,junit --reporter-json-export report-json.json --reporter-html-export report-html.html --reporter-junit-export report-xml.xml

注:需要将postman脚本事先上传到服务器

[root@ipha-dev71-1 postman_script]# cd /home/postman_script/     # postman脚本所在路径
[root@ipha-dev71-1 postman_script]# ll
total 8
-rw-r--r-- 1 root root  372 Aug 10 23:13 10.1.1.71.postman_environment.json
-rw-r--r-- 1 root root 3294 Aug 10 23:13 v3.x审方-0-用户登录和开始审方.postman_collection.json

3.查看构建结果

以下步骤非必须

4.将测试结果以文件格式保存(需安装插件HTML Publish)

构建后操作-增加构建后操作步骤-Publish Html Reports

猜你喜欢

转载自www.cnblogs.com/wang-mengmeng/p/11333259.html