在CentOS上生成Postman测试报告,通常借助Newman命令行工具,步骤如下:
sudo yum install -y nodejs npm
安装,安装后通过node -v
和npm -v
验证。npm install -g newman
命令全局安装,安装后用newman -v
验证。newman run your_collection.json -e your_environment.json -r html --reporter-html-export report.html
,其中your_collection.json
是集合文件,your_environment.json
是环境变量文件,report.html
是生成的报告文件名。若需更丰富的报告格式,可安装newman-reporter-htmlextra
等插件,再按相应参数生成报告。