postman自行安裝,windows的下載一個(gè)包一直點(diǎn)擊下一步就好
安裝npm工具,檢查安裝是否成功
npm -v
有版本號(hào)出現(xiàn)代表安裝成功
然后安裝newman執(zhí)行
npm install -g newman
安裝過(guò)程中出現(xiàn)失敗可以執(zhí)行
npm config set strict-ssl false
安裝HTML類型的報(bào)告
npm install newman-reporter-html
查看是否安裝newman成功,有版本號(hào)出現(xiàn)代表安裝成功
newman -v
把postman的腳本導(dǎo)出來(lái)。類似叫xxx.postman_collection.json
然后在cmd中執(zhí)行并把報(bào)告放在F盤的tmp文件夾里,報(bào)告名為test.html
newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r html --reporter-html-export F:\tmp\test.html
或者把跑的過(guò)程打印在界面,執(zhí)行
newman run "C:\Users\Admin\Desktop\xxx.postman_collection.json" -r cli --reporter-html-export F:\tmp\test.html
配置jenkins中,新建一個(gè)自有項(xiàng)目,然后在構(gòu)建時(shí)使用對(duì)應(yīng)的windows或者linux命令即可,看newman的安裝環(huán)境

image.png