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

Pytest+Allure生成可添加附件的测试报告

#测试套件层级
@allure.feature("测试PecExplorer")
#重试次数,粒度为用例,建议用例设计可重复性高
@pytest.mark.flaky(reruns=3)
class TestPecExplorer:#功能模块层级@allure.story("登录界面")#测试用例层级@allure.title("Test Case: TestPecExplorer")@allure.description("Transmit")def test_PecView(self, setup_driver):with allure.step("断言"):assert 1 == 1
if __name__ == '__main__':pytest.main(['-s', '-v','PecExplorerCase.py'])'''-q: 安静模式, 不输出环境信息-v: 丰富信息模式, 输出更详细的用例执行信息-s: 显示程序中的print/logging输出'''# 释放服务的端口号port_to_release = 5003release_port(port_to_release)# 结束进程process_kill("cmd.exe")# 生成测试报告time.sleep(3)os.system("allure generate ./temps -o ./reports --clean")time.sleep(3)# 开启测试报告服务,设置IP、端口号os.system(r"start allure open -h 192.168.169.131 -p 5003 ./reports")

函数process_kill()、release_port()见另一篇文章常用函数utils
添加附件的详细内容可见向Allure测试报告添加附件

测试报告展示
在这里插入图片描述

http://www.lryc.cn/news/195832.html

相关文章:

  • Spacedrive:开源跨平台文件管理 | 开源日报 No.57
  • c# 同步异步锁
  • 【Spring AOP】统⼀数据返回格式
  • python+django高校体育乒乓球场地预约管理系统_s2409
  • Python Selenium设计模式-POM
  • 【计算机毕设选题推荐】网络在线考试系统SpringBoot+SSM+Vue
  • AUTOSAR汽车电子嵌入式编程精讲300篇-基于FPGA的LIN总线控制器设计与验证(续)
  • Qt ModelView显示数据库数据
  • Vue-3.1缓存组件keep-alive
  • 14.8 Socket 一收一发通信
  • 7天狂揽 1.3w star 的 MetaGPT,他们的目标让软件公司为之一惊
  • 工控网络协议模糊测试:用peach对modbus协议进行模糊测试
  • python+opencv+机器学习车牌识别 计算机竞赛
  • 魔域服务端数据库说明
  • 笔记本无线网卡MAC一直改动
  • 【Tomcat】Apache发布两个新版本Tomcat修复多个Bug
  • Empowering Low-Light Image Enhancer through Customized Learnable Priors 论文阅读笔记
  • LeetCode 2652. 倍数求和【数学,容斥原理】简单
  • ansible-playbook剧本
  • 竞赛选题 深度学习LSTM新冠数据预测
  • 机械设计师应该在工作中培养哪些良好习惯?
  • 小程序新增功能页面
  • LeetCode每日一题——2652. Sum Multiples
  • Python问答题(更新中)
  • 服务器中了locked勒索病毒怎么办,勒索病毒解密,数据恢复
  • 游游的字母串 (环形数组两点之间的位置)
  • Flink的ResourceManager详解(一)
  • Tornado 可以使用 nginx 提供负载均衡
  • Golang 面向对象编程 多态
  • WLAN 无线案例(华为AC控制器配置模板)