Postman 命令行執行及生成漂亮的報告

命令行執行

安裝

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
使用在線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
貼一下報告的圖(htmlextra)

在這裏插入圖片描述
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章