zl程序教程

您现在的位置是:首页 >  其他

当前栏目

pytest + yaml 框架 -10.生成 allure 报告

2023-02-19 12:20:26 时间

前言

本插件是基于pytest框架开发的,所以pytest 的插件都能使用,生成报告可以用到 allure 报告 pip 安装插件

pip install pytest-yaml-yoyo

allure 报告功能在 v1.0.8 版本上实现

allure 命令行工具

allure 是一个命令行工具,需要去github上下载最新版https://github.com/allure-framework/allure2/releases

allure 命令行工具是需要依赖jdk 环境,环境内容自己去搭建了

生成 allure 报告

在用例所在的目录执行命令, --alluredir 是指定报告生成的目录

pytest --alluredir ./report

打开allure 报告执行命令

>allure serve ./report

查看报告

首页显示

图表查看

用例详情根据yaml文件名称和用例名称展示内容