Newman 是 Postman 推出的一个 nodejs 库,Newman 可以方便地运行和测试集合,并用之构造接口自动化测试和持续集成
1:安装和配置
安装node.js
验证:node.js是否安装成功
node -v
安装newman:npm install -g newman
配置newman环境:
验证:newman是否安装成功
newman -v
2:newman的命令
常见的参数
e: 使用环境变量-g: 使用全局变量-d: 使用 csv , text,json 数据驱动-n: 循环次数-r :cli,html,json,junit --reporter-html-export
命令:
newman run C:\Users\26555\Desktop\练习.postman_collection.json
生成测试报告
首先下载html:npm install -g newman-reporter-html
newman run C:\Users\26555\Desktop\练习.postman_collection.json -r html --reporter-html- export report123.html
结合Jenkins进行持续集成
成功