首页 > 其他分享 >pytest-allure相关

pytest-allure相关

时间:2022-10-06 16:46:45浏览次数:50  
标签:test001 allure step pytest pass report 相关

安装

  • mac 安装allure
     brew install alluer
    
  • 安装插件 allure-pytest
    pip3 install allure-pytest
    

生成报告

  • 第一种方式
    pytest test_01.py --alluredir=./report --clean-alluredir
    allure serve /Users/xxx/Documents/dev/report
    
  • 第二种方式
    pytest test_01.py --alluredir=./report --clean-alluredir
    allure generate ./report -o ./report/webreport # 第一个路径是生成的数据路径 第二个路径是生成html报告放到什么路径下面
    

allure函数使用

  • 一级标题allure.epic

    @allure.epic("测试登录模块1")
    def test001():
        with allure.step("打开浏览器"):
            pass
    
  • 二级标题allure.feature

    @allure.feature("测试登录模块2")
    def test001():
        with allure.step("打开浏览器"):
            pass
    
  • 三级标题allure.story

    @allure.story("测试登录")
    def test001():
        with allure.step("打开浏览器"):
            pass
    
  • 用例名称allure.title

    @allure.title("测试用例") # 测试报告讲函数名替换成该用例名称
    def test001():
        with allure.step("打开浏览器"):
            pass
    
  • 执行步骤allure.step

    @allure.title("测试用例") # 测试报告讲函数名替换成该用例名称
    def test001():
        with allure.step("打开浏览器"):
            pass
    

标签:test001,allure,step,pytest,pass,report,相关
From: https://www.cnblogs.com/py-zhq/p/16757910.html

相关文章

  • 线程类中的相关方法
    测试Thread中的常用方法:1,start():启动当前线程:调用当前线程的run()2,run():通常需要重写Thread类中的此方法,将创建的线程要执行的操作声明在此方法中3.currentThread():静态方法,返......
  • 面积相关公式与定理
    正弦定理在任意\(△ABC\)中,角\(A、B、C\)所对的边长分别为\(a、b、c\),三角形外接圆的半径为\(R\),直径为\(D\)。则有:余弦定理圆形面积交CF600D求圆形面积交。......
  • pytest结合allure 失败截图
    #[email protected]()defdriver():globaldriverdriver=webdriver.Chrome()driver.get("http://www.baidu.com")yiel......
  • 类型转换及相关函数
    4.11类型转换及相关函数在Python中,不同的数据类型是可以相互转换的,下面列举一些之前没有介绍但是比较常见的数据类型转换及相关函数,以供参考。4.11.1进制转换类4.11.1......
  • docker相关学习
    https://www.runoob.com/docker/docker-tutorial.html安装docker文档地址教程地址https://www.cnblogs.com/stormlong/p/10863061.htmlhttps://www.jb51.net/article/......
  • Linux/Cygwin助手函数:findremoteip,根据网络连接信息过滤查找特定远程IP,查询和终止Wind
    本函数Cygwin下测试通过,MSYS2,WSL1理论上可用(另:WSL2自然是不行),未经过测试!findremoteip函数代码:findremoteip(){ #根据网络连接的远程主机IP查找Windows相关进程: #目......
  • 【笔记】字符串相关
    Trie字典树构造trie上的每个节点表示一个字符,而trie的根到trie上某个节点的路径即代表了一个字符串。实现较为简单,每个节点记录字符集大小个儿子的\(\text{idx}\)......
  • Spring入门(一)--相关概念理解
    1、什么是Spring?Spring框架是一个开源的Java平台,它最初是由RodJohnson编写的,并且于2003年6月首次在Apache2.0许可下发布。Spring是轻量级的框架,其基础版本只有2MB......
  • 5.数学相关
    1.判断素数boolisPrime(intnum){ if(num==0||num==1)returnfalse; for(inti=2;i*i<=n;i++) if(num%i==0)returnfalse; returntrue;}......
  • 相关性分析散点图
    1. 散点图的用途散点图是用两组数据构成多个坐标点,观察坐标点的分布,判断两者之间是否存在某种关联或总结坐标点的分布模式。从散点图上可以解读两个变量的相互关系,所以......