手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

python3+pytest+allure框架搭建之allure详解

时间:2024-10-23 12:44:50

1、step1:allure可以切换到中文模式下

python3+pytest+allure框架搭建之allure详解

2、step2:使用前必须先引入模块:import allure,先来看一下效果图

python3+pytest+allure框架搭建之allure详解

3、step3:下面介绍一下allure的相关定制化具体特性功能模块方面的特性:1)feature(主要功能模块--一级标签)使用方法:@allure.feature()2)story(子功能模块--二级标签)使用方法:@allure.story()

python3+pytest+allure框架搭建之allure详解

4、step4:测试用例方面的特性:1)title(测试用例标题)使用方法: @allure.title2)description(测试用例描述)使用方法:@allure.description()3)step(测试用例步骤)使用方法:@allure.step()

python3+pytest+allure框架搭建之allure详解

5、step5:测试用例级别的特性:severity(BUG严重级别)1)使用方法:@allure.severity(allure.sev髫潋啜缅erity_level.CRITICAL)或者 @allure.severity('critical')2)相关说明: Allure中对严重级别的定义:blocker级别:中断缺陷(客户端程序无响应,无法执行下一步操作)critical级别:临界缺陷( 功能点缺失)normal级别:普通缺陷(数值计算错误)minor级别:次要缺陷(界面错误与UI需求不符)trivial级别:轻微缺陷(必输项无提示,或者提示不规范)

python3+pytest+allure框架搭建之allure详解

6、step6:链接方面的特性:link/i衡痕贤伎ssue/testcase(链接)使用方法:@allure.link(url='http多唉捋胝://www.baidu.com',name='link_url')@allure.issue(url='http://www.baidu.com',name='issue_url') #bug链接@allure.testcase(url='http://www.tapd.com',name='testcase_url')

python3+pytest+allure框架搭建之allure详解

7、step7:附件信息方面的特性:atta罕铞泱殳ch(附件信息)使用方法:@allure.attach(body荑樊综鲶, name, attachment_type, extension)body - 要写入文件的原始内容name - 包含文件名的字符串attachment_type - 其中一个allure.attachment_type值extension - 提供的将用作创建文件的扩展名

python3+pytest+allure框架搭建之allure详解
© 手抄报圈