AOEpeople / geb-spock-reports

Integrates Geb screenshots into the spock-reports library
Apache License 2.0
36 stars 11 forks source link

Using custom css styles #20

Closed smohylevskyi closed 5 years ago

smohylevskyi commented 5 years ago

Good day, guys! Our project was using spock-reports for a pretty long time for API test reports but recently we starred doing UI auto testing and your reports are very helpful, thanks a lot for your work!

My question is as follows: does your report support custom css styles as the original spock-report does?

I did a couple of tries to make it work but with no luck... Is your styling hardcoded into the lib or maybe I was just not able to do it correctly?

Thanks!

tilmanginzel commented 5 years ago

Hey @SergeyMogilevsky, thanks for the kind words! :)

Right now, it does not support the configuration of a separate CSS file. But in the meantime, you should be able to simply overwrite the current css files and then make your adaptations.

  1. Copy base.css, spec.css and summary.css to src/test/resources/templates/ in your project
  2. Make your changes

I will implement the possibility to configure a custom css file in the future.

rdmueller commented 5 years ago

Hi @SergeyMogilevsky ,

as Tilman already said, you can overwrite the CSS. But you can even do more with the templating feature of Spock-Reports.

You might want to take a look at this repository https://github.com/docToolchain/SpockAsciiDocReports where I used the template feature of spock-reports to not only use another stylesheet but even use a different report template (it now creates AsciiDoc reports: https://spockasciidocreports.netlify.com/spock-reports.html)

As Tilman already mentioned, the original Geb-Spock-Reports templates can be found at https://github.com/AOEpeople/geb-spock-reports/tree/master/src/main/resources/templates

So follow the instruction of Spock-Reports (https://github.com/renatoathaydes/spock-reports#customizing-the-reports) copy the original templates and modify the css - that should give you all the freedom you need...

Ralf

tilmanginzel commented 5 years ago

Indeed, the templating feature of spock-reports is quite nice, and only made this library (and others) possible! :) Writing a full-featured custom template can be quite some work though. So I think you should be able to add custom css, without the need to manually copy the original files.

tilmanginzel commented 5 years ago

@SergeyMogilevsky I have just published release v0.2.4 with the option to provide a custom css file. :)

I have also added some further documentation to the readme.

smohylevskyi commented 5 years ago

@tilmanginzel @rdmueller guys, thank you so much for the help! I will try and use this new feature asap. It's ok to close the thread now, right?