在Linux系统下使用Postman生成测试报告,通常需要通过Postman的Collection Runner功能来实现。以下是详细的步骤:
sudo apt-get install npm
或者 curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
然后 sudo apt-get install -y nodejs
npm install -g newman
newman run your_collection_file.json -e your_environment_file.json -r html --reporter-html-export report.html
其中,your_collection_file.json
是你的测试集合文件,your_environment_file.json
是环境变量文件,report.html
是你想要生成的报告文件名。
report.html
文件,用浏览器打开它以查看测试报告。请注意,上述步骤可能会随着Postman和Newman版本的更新而有所变化,建议参考最新的官方文档或教程进行操作。