引用:http://www.python3.vip/tut/auto/pytest/01/
针对以上文章的webui自动化,编写了对应的login_api接口自动化:
接口的调用方法:
利用pytest.mark.parametrize装饰器可以实现测试用例参数化
生成html报告:
python -m pytest --html=report/add_demo.html 生成报告
利用alluer生成报告:
python -m pytest --alluredir=report 生成报告数据
allure generate allure-report 渲染报告页面