postman用來做接口測試非常方便,接口較多時,則可以實現接口自動化
目錄
1、環境准備
2、本機調試腳本
3、集成jenkins
1、環境准備
1.1安裝nodejs6.0+
安裝nodejs6.0+(github上面寫的版本要求),用於安裝newman4.0+,到nodejs官網下載即可https://nodejs.org/en/download/releases/
1.2安裝newman
npm install -g newman
1.3安裝newman-reporter-html
npm install -g newman-reporter-html
2、本機調試腳本
2.1了解命令行執行腳本
可以查看github上面的命令說明https://github.com/postmanlabs/newman#configuring-reporters、https://github.com/postmanlabs/newman-reporter-html#readme
run XX.json #執行腳本
-
2.2從postman下載腳本到本機
下載腳本:
下載環境變量:
2.3本機調試出報告
在D盤下生成報告
3、集成jenkins
和其他項目配置jenkins一樣,新建一個構建,然后在構建的地方,配置一下,windows的批處理命令
點擊立即構建,查看控制台輸出
在D盤下同樣會生成報告
另:
1、還可以配置發送郵件等,本篇暫未介紹