serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
178 stars 280 forks source link

Support Doc Strings in Serenity reports #109

Open nmilosevic opened 1 year ago

nmilosevic commented 1 year ago

When using Doc Strings in your Cucumber steps, these strings are not visible in the Serenity Report.

I am using Serenity v3.6.12 and Serenity Gradle plugin v3.6.7.

Workaround for now seems to be having a method called at the end of each step definition that contains Doc Strings.

Example:

    public static void showCucumberDocStringsInSerenityReport(String docStrings) {
        StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(docStrings));
        StepEventBus.getEventBus().stepFinished();
    }

The issue here is that this works only when our Doc Strings are raw strings. If we are using custom transformers that convert e.g. JSON into a List or similar, this doesn't work.

wakaleo commented 1 year ago

What is a Doc String, and what problem are you trying to solve?