Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stylizing JBehave Reports

I am creating a collection of JBehave reports during my build that I would like to enhance. The default html reports that JBehave generates are very bland and could be tweaked for easier readability on my wiki when I post them for my customers. I would like to add some simple styling via css. However, I cannot find any examples on how to accomplish this.

Does anyone know how I can apply a custom css style to JBehave reports?

Here is how I'm generating the reports right now:

@Override
public Configuration configuration() {
    ...
    return new MostUsefulConfiguration()
            ....
            .useStoryReporterBuilder(new StoryReporterBuilder()
                    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                .withFormats( Format.TXT,
                              Format.HTML)
                ...
            );
}
like image 359
TERACytE Avatar asked Dec 02 '25 06:12

TERACytE


1 Answers

A couple things - the StoryReporter captures events during story processing - in various formats. A JBehave "view" can be created from the reports. For example the Jenkins/Hudson plugins will use the XML reports directly. But you can create a website JBehave view using the default Freemarker templates, css/js resources. You can customize those to your hearts content.

Look at the section on "View Generation" on http://jbehave.org/reference/stable/reporting-stories.html - that will get you started - and there are examples in the JBehave examples for view generation.

like image 104
Brian Repko Avatar answered Dec 03 '25 19:12

Brian Repko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!