一、newman在postman中的应用
1.首先要安装node.js
node.js安装配置参考:https://www.cnblogs.com/zhouyu2017/p/6485265.html
2.newman安装命令
npm install -g newman --registry=https://registry.npm.taobao.org
3.执行方式(两种)
执行导出测试集合的方式:
1).在postman测试集合中,选择导出(Export)
2).选择要保存的地方以后,在命令行中切换到存放导出测试集合的地方,输入命令newman run kuaijingxiao.postman_collection.json
*kuaijingxiao.postman_collection.json是postman中测试集合的名称
通过链接地址执行的方式:
1).在测试集合中选择Share,选择Collection Link,点击Copy To Clipboard拷贝测试集合的链接
2.在命令行中输入命令newman run https://www.getpostman.com/collections/15485a2cccf9521816f0,执行测试集合
二、newman基于postman生成html测试报告
安装html插件
npm install newman-reporter-html
在命令行中输入命令:newman run kuaijingxiao.postman_collection.json -r html