Styling JBehave reports

I am creating a collection of JBehave reports during my build that I would like to improve. By default, the html reports that JBehave generates are very soft and can be modified for readability in my wiki when I submit them to my clients. I would like to add some simple styling using CSS. However, I cannot find examples on how to do this.

Does anyone know how I can apply custom CSS styling for JBehave reports?

This is how I am generating reports right now:

@Override
public Configuration configuration() {
    ...
    return new MostUsefulConfiguration()
            ....
            .useStoryReporterBuilder(new StoryReporterBuilder()
                    .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                .withFormats( Format.TXT,
                              Format.HTML)
                ...
            );
}

      

+3


source to share


1 answer


A couple of things - StoryReporter captures events during history processing - in a variety of formats. You can create a JBehave "view" from reports. For example Jenkins / Hudson plugins will use XML reports directly. But you can create a JBehave view of a website using the default Freemarker templates, css / js resources. You can customize them in your heart.



Take a look at the Generation View section at http://jbehave.org/reference/stable/reporting-stories.html - this will get you started - and there are examples in the JBehave examples for generating views.

+3


source







All Articles