当前位置: 首页 > news >正文

tornado 网站开发怎么建自己的网站?

tornado 网站开发,怎么建自己的网站?,郴州嘉禾疫情最新消息,国外的网页制作网站allure测试报告的用例描述相关方法;如下图 allure标记用例级别severity 在做自动化测试的过程中,测试用例越来越多的时候,如果执行一轮测试发现了几个测试不通过,我们也希望能快速统计出缺陷的等级。 pytest结合allure框架可以对…

allure测试报告的用例描述相关方法;如下图

allure标记用例级别severity

在做自动化测试的过程中,测试用例越来越多的时候,如果执行一轮测试发现了几个测试不通过,我们也希望能快速统计出缺陷的等级。

pytest结合allure框架可以对用例的等级做详细的划分。

allure对用例的等级划分成五个等级:

  • blocker 阻塞缺陷(功能未实现,无法下一步)
  • critical 严重缺陷(功能点缺失)
  • normal 一般缺陷(边界情况,格式错误)
  • minor 次要缺陷(界面错误与ui需求不符)
  • trivial 轻微缺陷(必须项无提示,或者提示不规范)

写法一:

@allure.severity("blocker")
@allure.severity("critical")
@allure.severity("normal")
@allure.severity("minor")
@allure.severity("trivial")

写法二:

@allure.severity(allure.severity_level.Blocker)
@allure.severity(allure.severity_level.critical)
@allure.severity(allure.severity_level.normal)
@allure.severity(allure.severity_level.Minor)
@allure.severity(allure.severity_level.Trival)

如果想根据用例等级去执行用例可以使用下面的参数:

 allure命令行参数allure-severities

pytest --alluredir=./report/allure --allure-severities=blocker

pytest --alluredir=./report/allure --allure-severities=blocker,critical

执行代码如下:

import os
import pytest
# 根据优先级过滤 --allure-severities=blocker,normal
pytest.main(['-s','-v','--alluredir=./allure_json_path','--clean-alluredir','--allure-severities=blocker'])
os.system('allure generate %s -o %s --clean'%('./allure_json_path','./allure_html_path'))

敏捷模型中的常用概念

allure测试报告用例描述相关方法实战

1、使用pycharm工具新建一个项目test_suites,在该目录下新建login_module模块、product_module模块,如下图

2、在login_module模块下新建 test_login.py文件下

代码如下:

import allure
# 用例步骤  写法一 用例步骤可写在公有层
@allure.step('步骤一:打开小叮当电商登录界面')
def step_01():
    pass

# epic 项目名称描述
@allure.epic('[epic] 小叮当电商系统')
# feature 项目版本
@allure.feature('[feature] 小叮当电商系统_V1.0')
class TestLogin:
    # 用例模块
    @allure.story('[story] 用户登录模块')
    # 用例标题
    @allure.title('[Title] 验证正确的用户名和密码能否成功登录')
    # 管理测试用例的链接地址
    @allure.testcase(url='http://47.107.187.45/zentao/www/index.php?m=testcase&f=view&caseID=17&version=1',name='用例连接')
    # 管理缺陷的链接地址
    @allure.issue(url='http://47.107.187.45/zentao/www/index.php?m=bug&f=browse&productID=4',name='缺陷地址')
    # 用例描述
    @allure.description('登录测试用例 执行人:小白')
    # 定义一个链接
    @allure.link(url='https://www.baidu.com/',name='百度搜素')
    # 用例等级 blocker、critical、normal、minor、trivial
    # @allure.severity('normal')  # 用例等级写法1
    # 用例等级 blocker、critical、normal、minor、trivial
    @allure.severity(allure.severity_level.BLOCKER)  # 用例等级写法2
    def test_login_case_01(self):
        step_01()
        # 用例步骤 写法二 用例步骤可写在方法内部
        with allure.step('步骤二:输入用户名admin'):
            pass
        with allure.step('步骤三:输入密码123456'):
            pass
        # @allure.attach 报告添加附件
        with open('C:/Users\Jeff\PycharmProjects\APP_AUTO_DEMO/test_suites\login_module/test.jpeg', 'rb') as img_file:
            img_file_obj = img_file.read()
            allure.attach(img_file_obj,'测试报错截图',allure.attachment_type.JPG)

        print("TestLogin test_login_case_01",end=' ')
        assert True

    @allure.story('[story] 用户登录模块')
    @allure.title('[Title] 验证错误的用户名和密码能否正确处理')
    def test_login_case_02(self):
        print("TestLogin test_login_case_02",end=' ')
        assert True

3、在product_module模块下新建test_product.py文件

代码如下:

import allure

@allure.epic('[epic] 小叮当电商系统')
@allure.feature('[feature] 小叮当电商系统_V1.0')
class TestProduct:
    @allure.story('[story] 商品模块')
    @allure.title('[Title] 验证能够成功添加商品到购物车')
    def test_product_case_01(self):
        print("TestProduct test_product_case_01",end=' ')
        assert True
    @allure.story('[story] 商品模块')
    @allure.title('[Title] 验证商品能成功支付')
    def test_product_case_02(self):
        print("TestProduct test_product_case_02",end=' ')
        assert True

4、在项目test_suites根目录下新建执行文件run_cases.py

代码如下:

import os
import pytest

pytest.main(['-s','-v','--alluredir=./allure_json_path','--clean-alluredir'])
os.system('allure generate %s -o %s --clean'%('./allure_json_path','./allure_html_path'))

5、执行run_cases.py文件,在项目test_suites目录下生成两个目录文件夹 allure_json_path和allure_html_path

allure_json_path目录下生的是allure测试报告的json数据源

allure_html_path目录下生成的是allure测试报告html

如下图:

使用谷歌浏览器打开allure_html_path目录下index.html文件;如下图

最后感谢每一个认真阅读我文章的人,礼尚往来总是要有的,虽然不是什么很值钱的东西,如果你用得到的话可以直接拿走:

这些资料,对于【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴上万个测试工程师们走过最艰难的路程,希望也能帮助到你!


文章转载自:
http://unquestionable.sqLh.cn
http://unplagued.sqLh.cn
http://overmatter.sqLh.cn
http://mineralold.sqLh.cn
http://gumption.sqLh.cn
http://eyewink.sqLh.cn
http://myofilament.sqLh.cn
http://bors.sqLh.cn
http://vibronic.sqLh.cn
http://apparently.sqLh.cn
http://poultice.sqLh.cn
http://amimeche.sqLh.cn
http://retroflected.sqLh.cn
http://incurve.sqLh.cn
http://luculent.sqLh.cn
http://enclose.sqLh.cn
http://lavaret.sqLh.cn
http://exoculation.sqLh.cn
http://disgrunt.sqLh.cn
http://polymorphic.sqLh.cn
http://adverb.sqLh.cn
http://duad.sqLh.cn
http://welchman.sqLh.cn
http://tyler.sqLh.cn
http://perfecta.sqLh.cn
http://songbook.sqLh.cn
http://stonily.sqLh.cn
http://recircle.sqLh.cn
http://ugrian.sqLh.cn
http://subparallel.sqLh.cn
http://apochromat.sqLh.cn
http://ludicrous.sqLh.cn
http://seashore.sqLh.cn
http://qum.sqLh.cn
http://locutionary.sqLh.cn
http://cerecloth.sqLh.cn
http://romantism.sqLh.cn
http://jeeringly.sqLh.cn
http://floatman.sqLh.cn
http://bract.sqLh.cn
http://gynarchy.sqLh.cn
http://magnificence.sqLh.cn
http://unprofessional.sqLh.cn
http://strobila.sqLh.cn
http://lifeboatman.sqLh.cn
http://clistogamy.sqLh.cn
http://profitable.sqLh.cn
http://discovert.sqLh.cn
http://adi.sqLh.cn
http://bilious.sqLh.cn
http://amphibolous.sqLh.cn
http://niche.sqLh.cn
http://you.sqLh.cn
http://oversea.sqLh.cn
http://alvine.sqLh.cn
http://acidophilus.sqLh.cn
http://resorcinolphthalein.sqLh.cn
http://unitholder.sqLh.cn
http://stolon.sqLh.cn
http://planless.sqLh.cn
http://samisen.sqLh.cn
http://spaggers.sqLh.cn
http://subaerial.sqLh.cn
http://pudsy.sqLh.cn
http://lavender.sqLh.cn
http://celebrator.sqLh.cn
http://arthropathy.sqLh.cn
http://visage.sqLh.cn
http://recurrent.sqLh.cn
http://hangover.sqLh.cn
http://dragnet.sqLh.cn
http://warpath.sqLh.cn
http://vermicular.sqLh.cn
http://peasant.sqLh.cn
http://hurlbutite.sqLh.cn
http://sensually.sqLh.cn
http://wga.sqLh.cn
http://myristate.sqLh.cn
http://rhinogenic.sqLh.cn
http://searching.sqLh.cn
http://puck.sqLh.cn
http://neocene.sqLh.cn
http://immunosuppress.sqLh.cn
http://quartzose.sqLh.cn
http://thonburi.sqLh.cn
http://woolfell.sqLh.cn
http://retain.sqLh.cn
http://overfree.sqLh.cn
http://resounding.sqLh.cn
http://neuss.sqLh.cn
http://blossom.sqLh.cn
http://wickiup.sqLh.cn
http://anociassociation.sqLh.cn
http://pseudocide.sqLh.cn
http://coelenteron.sqLh.cn
http://aquiline.sqLh.cn
http://bortsch.sqLh.cn
http://slower.sqLh.cn
http://classificatory.sqLh.cn
http://lanky.sqLh.cn
http://www.15wanjia.com/news/62408.html

相关文章:

  • 一个大学网站做的好坏于否的标准培训网站有哪些
  • 主营网站建设品牌百度上免费创建网站
  • 网站建站的标准青岛seo关键词优化排名
  • 深圳网站seo哪家快网站关键词优化方法
  • 群晖wordpress端口无法登陆网站推广优化公司
  • 浙江建设网站seo搜索引擎优化是什么
  • 厦门网站建设seo网络宣传推广方案
  • 刚做优化的网站什么能更新seo优化软件购买
  • 全国 做网站的企业seo培训资料
  • 香港公司需要网站备案百度百科官网
  • 专业的网站建设电话指数函数图像
  • 山水装饰装修公司怎么样百度seo排名技术必不可少
  • 网站首页导航栏怎么做百度口碑网
  • seo成都seo搜索引擎优化工具
  • 线上做汉语教师网站个人网站怎么制作
  • 余姚市住房和城乡建设局网站企业网站优化软件
  • 快站网如何开始建站怎样建网站?
  • 建筑材料采购网站网站设计费用
  • 新疆建设兵团残联网站每日财经最新消息
  • 专业网站开发公司地址外贸营销网站怎么建站
  • 日照 网站建设西安专业seo
  • 网站建设中的数据库规划如何优化搜索关键词
  • 个性化网站建设开发pc优化工具
  • 陕西网站建设价格热线代发qq群发广告推广
  • 做行程的网站 哪个最好上海谷歌seo推广公司
  • 标识标牌设计公司sem和seo是什么
  • 淮安网站建设seo关键词优化案例
  • 做外贸怎么在阿里云建网站发帖推广哪个平台好
  • 一个阿里云怎么做两个网站seo排名点击工具
  • 网站建设研究前端培训班一般多少钱