Serenity Reports Logo Change

久未见 提交于 2020-01-05 03:37:51

问题


I am using Serenity with Jbehave. i would like to know how to replace the current reports default logo of serenity to a custom company logo. what is the code changes need to be done for changing the default logo.


回答1:


You can do that by replacing the serenity-bdd-logo.png in serenity-report-resources-x.x.xx.jar. Save your logo and name it likewise, then copy and overwrite the existing one. Mine is stored in the following location:

serenity-report-resources-x.x.xx.jar\report-resources\images\

This should work for any project running on your machine and using that single jar file. It is made easier with Maven as it stores all downloaded dependencies in one location.

Otherwise, I doubt there is any legitimate way to perform this trick. You can write Java code to rename your logo and copy it to reports location each time you run serenity reports, but all that are just hacks really :)

Serenity reports are built out of FreeMaket Template Language (.ftl) files stored in serenity-report-resources-x.x.xx.jar (another possible solution is to overwrite these and reference your own file each time serenity-bdd-logo.png is mentioned). Ideally you would want to create your own jar and force serenity to use this one. However, that seems a lot work just to replace a logo. Makes sense if you want to overhaul the whole look and feel of the reports.



来源:https://stackoverflow.com/questions/38913415/serenity-reports-logo-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!