以下json文件都为postman导出文件
1.安装node
验证:node -v
2.安装Newman:npm install -g newman
验证:newman -v
| 提示无权限:sudo chown -R $USER /usr/local/lib/node_modules
|
3.安装html:npm install newman-reporter-html
4.优化html:npm install -g newman-reporter-htmlextra
5执行命令
newman run postman_collection.json -r htmlextra,cli
newman run postman_collection.json -r htmlextra,cli --reporter-htmlextra-title “xxx-api Testcases” --reporter-htmlextra-browserTitle “xxx Report” --reporter-htmlextra-export /Desktop/newman/test.html
6.其他报告模版:https://pan.baidu.com/s/12ubes9rT6eDqEVz67AImng 提取码