allure的安装
打开terminal, 输入
pip3 install allure-pytest
安装allure包
下载地址:Central Repository: io/qameta/allure/allure-commandline
将allure添加路径到Path
#setting for allure
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PATH=${PATH}:/Applications/Python3.7/allure-2.9.0/bin(这里填你自己的路径)
配置好了之后输入
allure --version
查看是否安装好
Postman+allure report
首先指定生成allure_report的文件夹
newman run MPA.postman_collection.json -r allure --reporter-allure-export ./allure_report
然后根据allure_report里保存的结果生成html文件
allure generate allure_report/ -o allure_html --clean
生成好了之后可以通过如下命令打开
allure open allure_html/
这样就能看到精美的allure报告了

上面介绍的是newman的命令的简单运用,如果我们想要跑一些稍微复杂的postman脚本,可以用如下方法
Postman里有环境变量需要配置的话,可以用如下命令,将跑完的结果放在指定的allure_report文件夹下
newman run MPA.postman_collection.json -e MPAStaging.postman_environment.json -r allure --reporter-allure-export ./allure_report