# -*- coding: utf-8 -*-
# @Time : 2023/7/10 21:14
# @Author : yanfa
# @user : yanfa
# @File : test_attach_for_report_customization.py
# @remark: 報告定制
""""""
"""
一、Allure2 報告定制應用場景
應用場景:針對不同的項目可能需要對測試報告展示的效果進行定制
比如修改頁面的logo、修改項目標題、或者添加一些定制的功能等等
二、Allure2 報告定制-頁面 Logo
1、修改allure.yml文件,添加logo插件custom-logo-plugin
(在allure安裝路徑下,可以通過win-【where allure】或者mac-【which allure】查看allure安裝路徑)
【注意:使用brew安裝,默認路徑opt/homebrew/Celler/allure/2.22.4 下面有2個目錄 bin-執(zhí)行文件,libexec-bin/config/lib/plugins】
打開config下allure.yml最下面添加 -custom-logo-plugin
2、編輯styles.css文件,配置logo圖片
進入libexec/plugins/custom-logo-plugin/static目錄找到styles.css打開
將封面圖片放在static目錄下,替換下面內(nèi)容,替換為新文件名
/* 打開 styles.css 文件,
目錄在:/xxx/allure-2.13.2/plugins/custom-logo-plugin/static/styles.css,
將內(nèi)容修改為:*/
.side-nav__brand {
background: url("logo.png") no-repeat left center !important;
margin-left: 10px;
height: 40px;
background-size: contain !important;
}
三、Allure2 報告定制-頁面 Logo
編輯 styles.css 文件,添加修改標題對應的代碼。
/* 去掉圖片后邊 allure 文本 */
.side-nav__brand-text {
display: none;
}
/* 設置logo 后面的字體樣式與字體大小 */
.side-nav__brand:after {
content: "瘋子李";
margin-left: 18px;
height: 20px;
font-family: Arial;
font-size: 13px;
}
"""
def test_case():
pass
python接口自動化-allure2-報告定制
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。
相關(guān)閱讀更多精彩內(nèi)容
- 一、Pytest 介紹 1、基于 python 的單元測試框架 主流的接口測試框架有: python:pytest...
- 本文首發(fā)于:行者AI[https://xingzheai.cn/details/e9958cbc3b8] 在用py...
- 日常工作中,你是否遇到以下情形: 想要第一時間獲悉競品app的最新版本的更新內(nèi)容 想要監(jiān)測行業(yè)最新資訊,并與同事分...