1. 本機(jī)沒有安裝node.js,先安裝
1.1 去官網(wǎng)下載
地址1:https://nodejs.org/en/download/ ,我下載的是 【W(wǎng)indows 安裝包(.msi)】
地址2:https://nodejs.org
1.2 檢測PATH環(huán)境變量是否配置了Node.js
點(diǎn)擊開始 -- 運(yùn)行 -- cmd -- 輸入"path"
1.3 檢查Node.js版本
命令:node --version 或 node -v
2. 安裝Newman
2.1 全局安裝
cmd中敲入:npm install -g newman
2.2 安裝報(bào)告newman-reporter-html
cmd 輸入:npm install -g newman-reporter-html
樣式2:npm install -g newman-reporter-htmlextra
3. 使用
3.1 從postman下載腳本到本機(jī)
3.2 下載環(huán)境變量
3.3 本機(jī)調(diào)試報(bào)告樣式
newman run D:\AutoPresent\0.Login.json -e D:\AutoPresent\1.Test_enVirables.json -r html --reporter-html-export Test1218.html
newman run D:\AutoPresent\0.Login.json -e D:\AutoPresent\1.Test_enVirables.json -r htmlextra --reporter-html-export Test1218.html
3.4 去 jenkins 集成
新建一個(gè)構(gòu)建,然后在構(gòu)建的地方,配置 windows的批處理命令,點(diǎn)擊立即構(gòu)建,查看控制臺(tái)輸出,在導(dǎo)出的目標(biāo)文件夾下同樣會(huì)生成報(bào)告
cd /
cd C:\Users\Queenie\AppData\Roaming\npm
newman run D:\newman_qdd.postman_collection.json -e D:\qdd_bg_enviroment.postman_environment.json --reporters html --reporter-html-export D:\html001.html