【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)


相关推荐
zdr尽职尽责3 天前
UnityCli 兼容2022版本
ui·unity·ai·c#·游戏引擎
辰小忆4 天前
11 · RunCurveChart —— 实时运行曲线
c++·ui·duilib
敲上瘾6 天前
Qt核心机制:信号与槽详解
开发语言·c++·qt·ui·qt6.3
FRing037 天前
vue2干货总结10(json-server、vant-ui、postcss插件、axios二次封装、图形验证码、toast轻提示)
开发语言·前端·vue.js·ui·json·vue2·postcss
xy34538 天前
Axure 9.0 垂直菜单介绍
ui·产品经理·axure·原型设计
Oll Correct10 天前
Adobe illustrator 案例十四:花元素标志草图绘制
笔记·ui·adobe·illustrator
huaqianzkh11 天前
WinForm C#:循环修改控件UI闪烁卡顿?SuspendLayout / ResumeLayout 与 BeginUpdate 优化
开发语言·ui·c#
Oll Correct12 天前
Adobe illustrator 案例十三:adidas标志草图绘制
笔记·ui·adobe·illustrator
FungLeo12 天前
成为全栈·Vue 管理后台篇·Vue3 + Vite + Naive UI:后台工程基座怎么搭
前端·vue.js·ui·typescript·vite·前端工程化·biome
敲上瘾13 天前
Qt Widgets入门:项目模板解析与Hello World
开发语言·数据库·c++·qt·ui·qt6.3