阅读量:4
在Ubuntu上生成Postman报告需借助Newman工具,具体步骤如下:
- 安装Node.js和Newman:打开终端,依次运行
sudo apt update、sudo apt install nodejs npm安装Node.js和npm,再通过sudo npm install -g newman全局安装Newman。 - 安装报告插件:安装
newman-reporter-html插件以生成HTML报告,命令为sudo npm install -g newman-reporter-html。 - 导出Postman集合和环境变量:在Postman中选择要导出的集合,点击“Export”保存为JSON文件;若需环境变量,点击右上角齿轮图标,选择环境变量并下载为JSON文件。
- 生成测试报告:打开终端,进入导出文件所在目录,运行命令
newman run "集合文件名.json" -e "环境变量文件名.json" --reporters html --reporter-html-export "报告文件名.html",例如newman run "api-tests.postman_collection.json" -e "api-env.postman_environment.json" --reporters html --reporter-html-export "api-test-report.html"。
以上就是关于“Ubuntu Postman如何生成报告”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm