pytest-html
pytest-html copied to clipboard
Add logo to htmlreport.
Enhancement to add logo to Test Reports.

Hello @BeyondEvil @gnikonorov Bumping this up for review. Thanks
Hi @nirajnagle I've been busy with work, but perhaps @BeyondEvil or @ssbarnea can review
Nice!
Going to add this to the next-gen report.
Thanks @BeyondEvil
I'm also looking to add a logo and I stumbled upon this: @BeyondEvil any chances it can be merged now or has been found another solution in the meantime? Or maybe should I consider to fork and apply it on my own? Thank you again.
Edit
Already found a quick alternative without forking, by using the option --css=logo.css
with a logo.css like
h1 {
background : url(./logo-my-com-dark.svg) no-repeat top right; margin-right: 30px;
}
BTW I've also tested this patch but it looks like the call of the hook is missing in the report generator: I had to add the hook call session.config.hook.pytest_html_report_logo(report=self) in the code of html_report.py to make it work.
However (on my side) I've already solved my requirement via css, as explained above (and I'm happy with it atm)
I wonder if the easiest and best solution here is to just allow HTML in the title hook. That way the user can add a logo using HTML and CSS (via the --css option).