无论pytest还是httprunner都适用allure生成报告。那我们就有必要对allure报告进行一些定制。我们先修改logo:
1、给allure.yml插件custom-logo-plugin
找到allure安装的位置,在config文件夹下有一个allure.yml的配置文件。打开它,在最后添加custom-logo-plugin
2、修改插件里面的图片和样式
打开allure2.17.2/plugins/custom-logo-plugin/static文件夹,可以看到
当你做完第一步以后,如果再执行命令生成报告,logo已经替换为上面图片了
这时候需要再次从测试数据生成可视化网页文件
我们还需要修改一下styles.css文件样式:
allure generate C:\devlopePath\new_nergeryApp_auto\reports -o C:\devlopePath\new_nergeryApp_auto\result --clean
再次使用 allure open C:\devlopePath\new_nergeryApp_auto\result 生成即可
/*
.side-nav__brand {
background: url('custom-
本文介绍了如何自定义Allure报告的Logo和样式。首先,修改`allure.yml`配置文件,然后替换`custom-logo-plugin`静态文件夹中的图片。接着,更新`styles.css`以调整样式。通过`allure generate`命令生成报告,并使用`allure open`打开。此外,推荐了一个元素定位工具Chropath,使得定位操作更加简便。
订阅专栏 解锁全文
587

被折叠的 条评论
为什么被折叠?



