Pytest 测试框架与Allure 测试报告——Allure2测试报告-L4

目录:

  1. 1.allure2报告定制
    1. Allure2报告定制应用场景
    2. Allure2报告定制-页面Logo
    3. Allure2报告定制-页面标题

1.allure2报告定制

Allure2 报告定制应用场景

应用场景:针对不同的项目可能需要对测试报告展示的效果进行定制,比如修改页面的 logo、修改项目的标题或者添加一些定制的功能等等。

  1. 修改allure.yml 文件,添加 logo 插件custom-logo-plugin(在 allure 安装路径下,可以通过 where allure 或者which allure查看 allure 安装路径)。
  2. 编辑 styles.css 文件,配置 logo 图片。
bash 复制代码
/* 打开 styles.css 文件,
目录在:/xxx/allure-2.13.2/plugins/custom-logo-plugin/static/styles.css,
将内容修改为:*/
 
.side-nav__brand {
  background: url("logo.png") no-repeat left center !important;
  margin-left: 10px;
  height: 40px;
  background-size: contain !important;
}
Allure2 报告定制-页面标题
  • 编辑 styles.css 文件,添加修改标题对应的代码。
bash 复制代码
/* 去掉图片后边 allure 文本 */
.side-nav__brand-text {
  display: none;
}
 
/* 设置logo 后面的字体样式与字体大小 */
.side-nav__brand:after {
  content: "要修改的标题";
  margin-left: 18px;
  height: 20px;
  font-family: Arial;
  font-size: 13px;
}
相关推荐
学习3人组1 小时前
Python + requests + pytest + allure + Jenkins 构建完整的接口自动化测试框架
python·jenkins·pytest
shao9185163 天前
Gradio全解14——使用Gradio构建MCP的服务器与客户端(4)——Python包命令:uv与uvx实战
pytest·uv·1024程序员节·npx·uvx·uv pip·ruff
我的xiaodoujiao4 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 20--PO(POM) 设计模式和用例撰写
python·学习·测试工具·设计模式·pytest
sky0Lan5 天前
一个类似 pytest 的 html 报告
android·html·pytest
一半烟火以谋生6 天前
Python + Pytest + Allure 自动化测试报告教程
开发语言·python·pytest
一半烟火以谋生7 天前
pytest conftest.py 使用教程
pytest
我的xiaodoujiao7 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 19--测试框架Pytest基础 3--前后置操作应用
python·学习·测试工具·pytest
鱼鱼说测试7 天前
pytest+yaml+allure接口自动化测试框架
pytest
ThreeAu.10 天前
pytest 实战:用例管理、插件技巧、断言详解
python·单元测试·pytest·测试开发工程师
我的xiaodoujiao10 天前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 18--测试框架Pytest基础 2--插件和参数化
python·学习·测试工具·pytest