httprunner 3.x学习15 - allure报告环境准备

2021-08-01 02:56

阅读:834

标签:evel   tar   dex   lock   attribute   imp   uninstall   index   lan   前言 httprunner 3.x版本是基于 pytest 的,pytest 当然是可以支持 allure 报告了 windows环境版本: python 3.6版本 pytest 5.4.3版本 allure-pytest 2.8.6 最新版 allure 命令行 2.13.0 版本 allure-pytest 环境准备 使用 pip 安装 allure-pytest, 加上--index-url 国内下载源,下载会快一些 pip install allure-pytest==2.8.6 --index-url https://pypi.douban.com/simple 运行用例时候如果报错:AttributeError: module ‘allure‘ has no attribute ‘severity_level‘ 这个是pytest-allure-adaptor 这个插件与 allure-pytest 不能共存,卸载掉 pytest-allure-adaptor pip uninstall pytest-allure-adaptor allure 命令行工具 allure 是一个命令行工具,需要去github上下载https://github.com/allure-framework/allure2/releases 注意不要下载2.13.10版本,这个版本有问题,很多同学使用这个版本会出现打开allure报告是空白页 下载完成之后,解压到本地电脑 把bin目录添加到环境变量Path下 打开cmd窗口输入allure,出现内容说明allure命令行工具安装成功 生成 allure 报告 运行用例和生成allure报告是2个分开的步骤,运行用例生成json格式的报告文件,--alluredir 指定报告路径 >hrun testcases/login_env.yml --alluredir ./allure_report 也可以用pytest命令运行py文件 >pytest testcases/login_userinfo_test.py --alluredir ./allure_report 运行后会在当前目录生成allure_report文件夹,使用allure目录行工具启动服务 >allure serve ./allure_report allure_report 文件夹内容 生成的allure报告,用浏览器打开httprunner 3.x学习15 - allure报告环境准备标签:evel   tar   dex   lock   attribute   imp   uninstall   index   lan   原文地址:https://www.cnblogs.com/yoyoketang/p/14918924.html


评论


亲,登录后才可以留言!