如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 平常我们功能测试用例非常多时,比如有1千条用例,假设每个用例执行需要1分钟,如果单个测试人员执行需要1000分钟才能跑完 当项目非常紧急时,会需要协调多个测试资源来把任务分成两部分,于是执行时间缩短一半,如果有10个小伙伴,那么执行时间就会变成十分之一,大大节省了测试时间 为了节省项目测试时间,10个测试同时并行测试,这就是一…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 pytest中可以用python的assert断言,也可以写多个断言,但一个失败,后面的断言将不再执行 安装插件 pip3 install pytest-assume -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com assert多重断言 def…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 allure除了支持pytest自带的特性之外(fixture.parametrize.xfail.skip),自己本身也有强大的特性可以在pytest中使用 @allure.step allure报告最重要的一点是,它允许对每个测试用例进行非常详细的步骤说明 通过 @allure.step() 装饰器,可以让测试用例在all…
一.@allure.step的用法 可以理解为我们编写测试用例中的每一步操作步骤,而在allure中表示对每个测试用例进行非常详细的步骤说明 通过 @allure.step(),可以让测试用例在allure报告中显示更详细的测试过程 示例代码 # -*- coding: utf-8 -*- # @Time : 2020/12/12 8:34 # @Author : longrong.lang # @FileName: test_allure.py # @Software: PyCharm # @…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 前面介绍了两种allure的特性 @allure.step() 装饰器:可以设置测试步骤,让测试用例的执行过程更加详细 allure.attach() 函数:可以设置需要显示在allure报告的附件,包含了多种类型,可以通过allure.attachment_type查看支持的类型 这一篇幅,我们主要来讲解另外两个特性,可以增…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 先看看 allure 命令的帮助文档 cmd 敲 allure -h allure 命令的语法格式 allure [options] [command] [command options] options 列表 Options: --help 命令行帮助文档 -q, --quiet 切换至安静模式 Default: false -v…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html allure 和 pytest 相关环境安装 # allure pip3 install allure-pytest -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com #pytest pip3 install pytest -i http://pypi.…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 参数化 @pytest.mark.parametrize 的学习:https://www.cnblogs.com/poloyy/p/12675457.html 默认 allure 报告上的测试用例标题不设置默认就是用例名称,这样可读性不高 当结合 @pytest.mark.parametrize 参数化完成数据驱动时,如果标题…
如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 @allure.title 和 @allure.description 都是装饰器,给测试用例提供标题和描述 其实 allure 还提供了在测试用例执行过程中动态指定标题和描述等标签的方法 如: allure.dynamic.description  allure.dynamic.title allure.dynamic 的源…
pytest是什么 pytest是python的一款测试框架,拥有unittest的功能并比它更丰富. allure是什么 有非常多的优秀的测试框架,但却是有非常少优秀的报告工具可以展示非常清楚的用例执行过程和结果. allure是一款开源的,专门用来展示测试结果的工具,目的是希望团队内部每一个人都可以看到非常清楚的测试结果. allure可以与非常多的著名测试框架做集成. 像java语言,可以与junit4,junit5,TestNG测试框架集成. python语言,可以与pytest,beh…