摘要: 前言 pytest+allure是最完美的结合了,关于allure的使用,本篇做一个总结。 allure报告可以很多详细的信息描述测试用例,包括epic、feature、story、title、issue、testcase、severity等 环境准备 python 3.6 pytest 4.5.0 阅读全文
posted @ 2020-07-04 16:26 wakey 阅读(744) 评论(0) 推荐(0) 编辑
摘要: pytest结合allure框架可以对用例的等级做详细的划分。 用例等级 allure对用例的等级划分成五个等级 blocker 阻塞缺陷(功能未实现,无法下一步) critical 严重缺陷(功能点缺失) normal 一般缺陷(边界情况,格式错误) minor 次要缺陷(界面错误与ui需求不符) 阅读全文
posted @ 2020-07-04 16:15 wakey 阅读(722) 评论(0) 推荐(0) 编辑
摘要: allure-pytest 环境准备 windows环境相关: python 3.6版本 pytest 4.5.0版本 allure-pytest 2.8.6 最新版 使用pip安装pytest和allure-pytest,加上--index-url地址,下载会快一些 pip install pyt 阅读全文
posted @ 2020-07-04 16:07 wakey 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 并行测试 多cpu并行执行用例,直接加个-n参数即可,后面num参数就是并行数量,比如num设置为3: pytest -n 3 使用pytest-xdist插件也能生成html报告,完美支持pytest-html插件 pytest -n 3 --html=report.html --self-con 阅读全文
posted @ 2020-07-04 15:53 wakey 阅读(356) 评论(0) 推荐(0) 编辑
摘要: pytest -h 命令行输入pytest -h,找到里面两个命令行参数: --lf 和 --ff --lf, --last-failed 只重新运行上次运行失败的用例(或如果没有失败的话会全部跑) --ff, --failed-first 运行所有测试,但首先运行上次运行失败的测试(这可能会重新测 阅读全文
posted @ 2020-07-04 15:40 wakey 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 使用pip安装pytest-repeat pip install pytest -repeat 重复执行--count 命令行执行:pytest baidu/test_1_baidu.py -s --count=5 文件中写参数执行 在代码中标记要重复多次的测试 @pytest.mark.repea 阅读全文
posted @ 2020-07-04 15:26 wakey 阅读(1413) 评论(0) 推荐(0) 编辑