【UI自动化测试】6_TPshop项目实战 _allure测试报告

文章目录

一、环境安装

1、allure-2.13.0:完全独立的工具包,

官网下载地址: https://github.com/allure-framework/allure2/releases

备用网址:https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/ (windows下载.zip包)

bash 复制代码
配置系统变量步骤:系统变量Path 添加 allure安装目录\bin

cmd输入:allure --version能查看到版本号即代表成功

2、 allure-pytest第三方包安装

bash 复制代码
pip install allure-pytest

3、pytest.ini配置

ini 复制代码
--alluredir=报告路径

二、allure测试报告

2.1 生成测试报告

1、运行测试用例,会在指定的目录生成测试报告数据文件

2、allure generate 结果文件目录 -o html报告目录 --clean

bash 复制代码
①allure generate 把测试报告数据文件 转义 成html测试报告
②结果文件目录:数据文件目录
③-o:转义的意思
④html报告目录:新生成测试报告的目录
⑤--clean:清除缓存的意思,没有也可以
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
allure generate ./report -o ./report/html --clean

2.2 allure报告插入截图

python 复制代码
# 有时,想把错误截图输入到测试报告中。
# allure.attachment_type.PNG 指定图片类型

allure.attach(driver.get_screenshot_as_png(),"图片名称",allure.attachment_type.PNG)


相关推荐
少云清6 小时前
【UI自动化测试】3_TPshop项目实战 _一个测试用例脚本编写过程
ui·测试用例
Jasmine8396 小时前
OpenClaw部署太难? Codex全流程零编码实现浏览器UI自动化
人工智能·测试工具·ui
不如摸鱼去11 小时前
uni-app 组件库 Wot UI 的 AI 友好型编程指南
人工智能·ui·uni-app
大Mod_abfun12 小时前
AntdUI教程#1ChatList交互(vb.net)
服务器·前端·ui·交互·antdui·聊天框
少云清12 小时前
【UI自动化测试】2_IOS自动化测试 _使用模拟器
ui·ios
带娃的IT创业者12 小时前
UI 交互难题攻克:遮挡、弹窗、动态加载
ui·交互·文件上传·浏览器自动化·playwright·ui 交互·元素遮挡
修炼前端秘籍的小帅14 天前
Stitch——Google热门的免费AI UI设计工具
前端·人工智能·ui
王码码203514 天前
Flutter for OpenHarmony:socket_io_client 实时通信的事实标准(Node.js 后端的最佳拍档) 深度解析与鸿蒙适配指南
android·flutter·ui·华为·node.js·harmonyos
2501_9219308314 天前
Flutter for OpenHarmony:第三方库实战 chewie 视频播放器UI组件详解
flutter·ui