在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等插件,再按相应参数生成报告。