newman+postman+jenkins测试

2019-10-29  本文已影响0人  年轻的菜鸟

postman自行安装,windows的下载一个包一直点击下一步就好
安装npm工具,检查安装是否成功

npm -v

有版本号出现代表安装成功
然后安装newman执行

npm install -g newman

安装过程中出现失败可以执行

npm config set strict-ssl false

安装HTML类型的报告

npm install newman-reporter-html

查看是否安装newman成功,有版本号出现代表安装成功

newman -v

把postman的脚本导出来。类似叫xxx.postman_collection.json

然后在cmd中执行并把报告放在F盘的tmp文件夹里,报告名为test.html

newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r html --reporter-html-export F:\tmp\test.html

或者把跑的过程打印在界面,执行

newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r cli --reporter-html-export F:\tmp\test.html

配置jenkins中,新建一个自有项目,然后在构建时使用对应的windows或者linux命令即可,看newman的安装环境

image.png
上一篇下一篇

猜你喜欢

热点阅读