postman高级应用(6)_Newman生成漂亮的报告

命令行执行
安装
newman介绍

Node.js下载

postmanApi文档,可生成apikey

newman 相关报告插件,可查看详细报告插件用法

#首先安装node.js,然后npm安装newman
npm install -g newman
newman run examples/sample-collection.json -r cli,json
npm install -g newman-reporter-html #基础html报告
npm install -g newman-reporter-htmlextra #美化全面的html报告
newman run /path/to/collection.json -r htmlextra,csv
1
2
3
4
5
6
使用在线collections运行
1 Generate an API key
2 Fetch a list of your collections from: https://api.getpostman.com/collections?apikey=$apiKey
3 Get the collection link via it’s uid: https://api.getpostman.com/collections/$uid?apikey=$apiKey
4 Obtain the environment URI from: https://api.getpostman.com/environments?apikey=$apiKey
5 Using the collection and environment URIs acquired in steps 3 and 4, run the collection as follows:

newman run "https://api.getpostman.com/collections/$uid?apikey=$apiKey" --environment "https://api.getpostman.com/environments/$uid?apikey=$apiKey" -r htmlextra,cli
1
贴一下报告的图(htmlextra)

 

 

亲测示例:

安装HTML加强版插件后:

执行命令:newman run sdve-sentence.postman_collection.json -d data.csv -r htmlextra,cli

 

 



posted @ 2019-12-10 21:27  吃个鱼丸  阅读(1021)  评论(0)    收藏  举报