pytest--allure报告中添加用例详情
前言
import allure class TestCase: @allure.title('用例1的名称') def test_01(self): print('---用例01---') assert 1 @allure.title('用例2的名称') def test_02(self): print('---用例02---') assert 1 @allure.title('用例3的名称') def test_03(self): print('---用例03---') assert 2
import allure class TestCase: @allure.title('用例1的名称') def test_01(self): '''用例_01的描述内容''' print('---用例01---') assert 1 @allure.title('用例2的名称') def test_02(self): '''用例_02的描述内容''' print('---用例02---') assert 1 @allure.title('用例3的名称') def test_03(self): '''用例_03的描述内容''' print('---用例03---') assert 2
import allure class TestCase: @allure.title('登录用户') def test_01(self): '''登录用户''' print('---用例01---') with allure.step('输入登录用户名'): print('输入用户名') with allure.step('输入登录的密码'): print('输入密码') with allure.step('点击登录'): print('点击登录!') assert 1 @allure.title('进入测试页面') def test_02(self): '''进入测试页面''' print('---用例02---') with allure.step('进入测试页面'): print('进入测试页面') with allure.step('点击测试内容'): print('点击测试内容') assert 1
import allure class TestCase: @allure.issue('https://home.cnblogs.com/u/qican/') @allure.testcase('https://www.baidu.com/') @allure.title('登录用户') def test_01(self): '''登录用户''' print('---用例01---') with allure.step('输入登录用户名'): print('输入用户名') with allure.step('输入登录的密码'): print('输入密码') with allure.step('点击登录'): print('点击登录!') assert 1 @allure.issue('https://home.cnblogs.com/u/qican/') @allure.testcase('https://www.baidu.com/') @allure.title('进入测试页面') def test_02(self): '''进入测试页面''' print('---用例02---') with allure.step('进入测试页面'): print('进入测试页面') with allure.step('点击测试内容'): print('点击测试内容') assert 1
import allure @allure.epic("属于登录标签") @allure.feature('登录模块') class TestCase: @allure.title('登录用户') def test_01(self): '''登录用户''' print('---用例01---') with allure.step('输入登录用户名'): print('输入用户名') with allure.step('输入登录的密码'): print('输入密码') with allure.step('点击登录'): print('点击登录!') assert 1 @allure.title('进入测试页面') def test_02(self): '''进入测试页面''' print('---用例02---') with allure.step('进入测试页面'): print('进入测试页面') with allure.step('点击测试内容'): print('点击测试内容') assert 1 @allure.epic("属于退出登录标签") @allure.feature('退出登录模块') class Test01: def test_01(self): print('---用例03---') def test_02(self): print('---用例04---')
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
2020-02-07 Django---Django安装数据库