当前位置: 首页 > news >正文

26、pytest使用allure解读

官方实例

# content of pytest_quick_start_test.py
import allurepytestmark = [allure.epic("My first epic"), allure.feature("Quick start feature")]@allure.id(1)
@allure.story("Simple story")
@allure.title("test_allure_simple_test displayName")
def test_allure_simple_test():with allure.step("Simple step"):passwith allure.step("Simple parent step"):with allure.step("Simple child step"):passsimple_step_func("function parameter")@allure.step("Simple function with step decorator")
def simple_step_func(param):with allure.step(f"function parameter: {param}"):passwith allure.step("Simple step inside test function"):pass

解读与实操

  1. 运行代码

    在这里插入图片描述

  2. 生成报告

在这里插入图片描述

  1. 查看报告

在这里插入图片描述

场景应用

1、allure是定义分类层级,由大到小依次为“epic”(迭代)、“feature”(需求),“story”(场景),“title”(功能点),可以根据实际项目使用全部或部分。仅仅为了进行分类。

2、每个测试用例中增加step描述,展示执行步骤的含义,既可以向项目干系人体现测试思路,又可以在测试出问题后清晰向他人描述问题。

http://www.lryc.cn/news/253963.html

相关文章:

  • Uncle Maker: (Time)Stamping Out The Competition in Ethereum
  • 浅谈可重入与线程安全
  • 深入理解TDD(测试驱动开发):提升代码质量的利器
  • pyqt5使用pyqtgraph实现动态热力图
  • 【android开发-16】android中文件和sharedpreferences数据存储详解
  • 《当代家庭教育》期刊论文投稿发表简介
  • 【操作教程】如何将外省医保转入广州市区(医保转移接续手续办理)?
  • 【分布式系统学习】CAP原理详解
  • 【聚类】K-modes和K-prototypes——适合离散数据的聚类方法
  • Python-炸弹人【附完整源码】
  • [英语学习][5][Word Power Made Easy]的精读与翻译优化
  • Apache Doris 详细教程(一)
  • 【Vue3从入门到项目实现】RuoYi-Vue3若依框架前端学习——登录页面
  • win11 关闭快速启动,解决重启后部分应用没有关闭的问题
  • python爬虫-某公开数据网站实例小记
  • 还记得当初自己为什么选择计算机?
  • “数”说新语向未来 | GBASE南大通用2023媒体交流会成功举办
  • 每天一点python——day88
  • xShell快捷键
  • OkGo导入失败解决办法
  • 02、pytest环境准备
  • 海上液化天然气 LNG 终端 ,数字孪生监控系统
  • C语言面试之旅:掌握基础,探索深度(面试实战之ARM架构二)
  • Axios详解及运用案例
  • 期刊影响因子和期刊分区(国内-中科院/国外-JCR分区)
  • R语言gWQS包在加权分位数和回归模型的应用
  • 【Makelist】release无法生成pdb
  • 【Linux】信号的保存和捕捉
  • Sourcepawn脚本入门(二)命令与事件监听
  • java-poi操作笔记