本文共 994 字,大约阅读时间需要 3 分钟。
两种方式任选其一:
1.pip install allure-pytest
2.pip install -i https://pypi.douban.com/simple allure-pytest
1.安装jdk并配置环境
https://www.jb51.net/softs/604550.html
2.下载allure并配置环境
百度云盘地址:链接:https://pan.baidu.com/s/1aop24DHNcOlOKFUH7waqVA 提取码:v7he
解压到任意盘下,将加压目录下的bin和lib文件夹设置为环境变量 cmd执行allure --version 显示:2.10.0版本1.执行全部
pytest --alluredir=./reports --clean-alluredir
注释:
2.执行指定类
pytest testcases/test_base_page.py::TestBase --alluredir=./reports --clean-alluredir
四.查看allure的报告
1.进入到项目目录,在cmd(不然会发生意料之外的错误)环境下执行
allure serve reports
注释:
2.生成本地文件
allure generate ./reports -o ./reports/html -c ./reports/html
注释:
3.运行多个模块下的多个测试case方法
pytest.main( [’-s’, ‘-k’, ‘test_establish_connection or test_order_runner’, “–alluredir=report/allure_result”])转载地址:http://ozjmf.baihongyu.com/