Allure - yml测试报告

Allure测试报告

  生成pytest-html报告

    1.首先在testcase同级创建一个report文件夹
    2.在cmd的项目目录中输入:hrun testcase --html=./report/report.html(这种情况下,css和html是分开的两个文件)
0
      hrun testcase --html=./report/report.html --self-contained-html(css和html是一个文件)
    3.report中生成report.html文件
      pytest testcase --html=./report/report.html --self-contained-html
      pytest --html=./report/report.html --self-contained-html(执行项目中所有的test开头或结尾的py文件)
      生成报告时,用pytest命令执行,hrun命令生成报告有bug

  Allure环境准备与生成报告

    allure-pytest环境准备
      pip安装allure-pytest
        pip install allure-pytest
      allure-pytest和pytest-allure-adaptor不能共存,用其中一个需要卸载掉另一个
      jdk环境配置
      allure环境配置:path中加入allure的路径
    验证:
      命令行输入:allure
0
      切换到文件目录下,输入:pytest --alluredir ./report/allure_report
0
      之后输入:allure serve ./report/allure_report
0
0
posted @   乌醍  阅读(48)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
点击右上角即可分享
微信分享提示