定制Allure报告
定制Allure报告
自定义Logo图标
效果图

实现步骤
-
定位资源文件夹:首先,您需要定位到
allure/plugins/custom-logo-plugin/static文件夹。这个文件夹通常包含Allure报告使用的静态资源,包括默认的Logo图像。

-
放置新Logo:将您的新Logo图像文件放置到
allure/plugins/custom-logo-plugin/static文件夹下。

-
编辑styles.css文件:接下来,您需要编辑
styles.css文件,以更新Logo的引用。(具体样式需要自行调试)
.side-nav__brand {
background: url('您的新Logo文件名.png') no-repeat left center !important;
background-size: 40px 40px !important;
padding-left: 40px !important;
margin-left: 10px;
}
.side-nav__brand span {
display: none;
}
.side-nav__brand:after {
content: "测试小罡"; /* 此处为示例,可根据需要替换为您的团队或项目名称 */
margin-left: 20px;
}
-
定位配置文件:接下来,定位到
allure/config文件夹。

-
编辑allure.yml文件:在
allure.yml文件中,您需要添加-custom-logo-plugin以启用自定义Logo插件。确保该文件中的插件列表包含此条目,如下所示:

-
运行pytest:执行命令,生成Allure报告
pytest --alluredir [所要生成静态数据地址]
allure generate [静态数据地址] -o [本地地址]

浙公网安备 33010602011771号