首页 > 其他 > 详细

allure--allure描述用例详细讲解

时间:2020-12-30 22:16:58      阅读:178      评论:0      收藏:0      [点我收藏+]

转:https://www.cnblogs.com/canglongdao/p/13414829.html

前言

pytest+allure是最完美的结合了,关于allure的使用,本篇做了一个总结。

allure报告可以包含很多详细的信息描述测试用例,包括epic、feature、story、title、issue、testcase、severity等

allure用例描述
技术分享图片

测试案例

pytest结合allure测试用例
技术分享图片
技术分享图片

执行用例
1、cd到test_a.py的目录
2、pytest --alluredir ./report/a  

生成报告:
allure serve ./report/a
  
报告展示内容
技术分享图片

命令行参数

pytest运行用例的时候可以加上allure标记用例的参数
--allure-severities=SEVERITIES_SET
Comma-separated list of severity names. Tests only
with these severities will be run. Possible values
are: blocker, critical, normal, minor, trivial.
--allure-epics=EPICS_SET
Comma-separated list of epic names. Run tests that
have at least one of the specified feature labels.
--allure-features=FEATURES_SET
Comma-separated list of feature names. Run tests that
have at least one of the specified feature labels.
--allure-stories=STORIES_SET
Comma-separated list of story names. Run tests that
have at least one of the specified story labels.
--allure-link-pattern=LINK_TYPE:LINK_PATTERN
Url pattern for link type. Allows short links in test,
like ‘issue-1‘. Text will be formatted to full url
with python str.format(). 

选择运行你要执行epic的用例

  pytest --alluredir ./report/allure --allure-epics=epic对大Story的一个描述性标签

选择运行你要执行features的用例

  pytest --alluredir ./report/allure --allure-features=模块2

选择运行你要执行features的用例

  pytest --alluredir ./report/allure --allure-stories="用户故事:1"

关于allure的使用基本上就是这些了

allure--allure描述用例详细讲解

原文:https://www.cnblogs.com/tkliu/p/14212613.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!