命令执行 ( newman )
npm install newman --global
npm install -g newman-reporter-html
C:\Users\27806>npm install -g newman-reporter-html npm WARN newman-reporter-html@1.0.5 requires a peer of newman@4 but none is installed. You must install peer dependencies yourself. + newman-reporter-html@1.0.5 added 12 packages from 44 contributors in 1.833s C:\Users\27806>npm install newman --global npm WARN deprecated har-validator@5.1.5: this library is no longer supported C:\Users\27806\AppData\Roaming\npm\newman -> C:\Users\27806\AppData\Roaming\npm\node_modules\newman\bin\newman.js + newman@5.2.3 added 132 packages from 152 contributors, removed 483 packages and updated 24 packages in 13.001s C:\Users\27806>newman -v 5.2.3
执行测试
C:\Users\27806>cd C:\Users\27806\Desktop\pmtest C:\Users\27806\Desktop\pmtest>newman run data_driver.postman_collection.json -d data.json -r html C:\Users\27806\Desktop\pmtest>
支持 txt文件的数据,如下:
C:\Users\27806>cd Desktop\pmtest
C:\Users\27806\Desktop\pmtest>newman run future_loan_ddt.postman_collection.json -d test_login.txt -r html
命令说明
html报告如下: