看阿里测试工程师如何玩转postman+newman+jenkins接口自动化
目录
postman用来做接口测试非常方便,接口较多时,则可以实现接口自动化
一、环境准备
1.安装nodejs6.0+
安装nodejs6.0+(github上面写的版本要求),用于安装newman4.0+,到nodejs官网下载即可https://nodejs.org/en/download/releases/
2.安装newman
1 |
|
3.安装newman-reporter-html
1 |
|
二、本机调试脚本
1.了解命令行执行脚本
可以查看github上面的命令说明https://github.com/postmanlabs/newman#configuring-reporters、GitHub - postmanlabs/newman-reporter-html
run XX.json #执行脚本
---reporters html --reporter-html-export /路径 #导出执行结果到此路径,若指定输出报告,则只会在dos窗口输出执行结果
-e XX.json #带上环境变量
2.从postman下载脚本到本机
下载脚本:
下载环境变量:
3.本机调试出报告
newman run D:\test.postman_collection.json --reporters html --reporter-html-export D:\html01.html
在D盘下生成报告
三、集成jenkins
和其他项目配置jenkins一样,新建一个构建,然后在构建的地方,配置一下,windows的批处理命令
点击立即构建,查看控制台输出
在D盘下同样会生成报告
python自动化测试资料下方小卡片领取↓
相关文章
- jenkins 插件开发资料
- Jenkins高危代码执行漏洞检测/开源漏洞靶场
- TeamCity vs Jenkins: Which is the Better Continuous Integration (CI) Server for .NET Software Development?
- 修改jenkins目录和端口及启动用户
- windows上Jenkins安装及其配置
- jenkins疑惑
- jenkins 可以设置最多执行并发执行多少个
- 使用Jenkins做自动化编译—如何正确的编写shell脚本
- 在Jenkins中配置执行远程shell命令
- Jenkins定时构建时间设置
- Gitlab+Jenkins学习之路(十二)之Maven的私有仓库Nexus