trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.

Home Page:https://www.softwaretester.blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New default expand option: expand only if there is something to display

tomaugs opened this issue · comments

For instance we can choose to expand or not by default after hooks, steps hooks and doc string. We can then toggle show/hide scenario and step hooks in the final report.

This enhancement request is to propose a new default option for the expandBeforeAfterHooks and expandStepHooks (maybe also for expandDocStrings but I don't use it) which would be: expand only if there is something to be displayed.

In my case I do error handling in an @AfterStep to embed the screenshot of the failure in the scenario. I can also throw an exception in this @AfterStep (in some cases).

So, today to be able to see by default the embedded screenshot and the stackTrace (if any), I need to set: true.
But if the failure is on the 10th step all the 9 firsts @AfterStep hooks don't have something to display. It is unnecessary to display the the 9 firsts hooks in this case, but only the 10th.

This request is maybe a little bit related to the issue #186 which is to be able to show/hide individual steps (and hooks ?).

The configuration possibilities would be:

    <expandBeforeAfterHooks>default|true|false</expandBeforeAfterHooks>
    <expandStepHooks>default|true|false</expandStepHooks>
    <expandDocStrings>default|true|false</expandDocStrings>

Thx,

Interesting idea. I will consider this.

I now changed the behavior that empty hooks are not displayed anymore (v. 2.6.0)