trivago/cucable-plugin

Support for Background in feature

mpujic opened this issue ยท 8 comments

Is your feature request related to a problem? Please describe.
I am having a lot of Background steps in my feature files, having them parsed in Cucable generated feature file and showing them in report as part of Scenario steps creates a lot of unnecessary text in scenario, thus making it less "human" readable.

Is it possible to have them parsed in generated Cucable feature files as Background?

Describe the solution you'd like
Have Background steps stay in Background section after generated feature files are created.

Describe alternatives you've considered
I have considered plain usage of Maven Surefire / Failsafe in combination with JUnit and Cucumber, but that creates other problems with having json file overwritten by rerun of scenario (https://stackoverflow.com/questions/50115819/cucumber-json-report-getting-overwritten-by-rerun-scenario-report/50160234#50160234).
Functionality which is offered with Cucable plugin which creates separate runner and feature file per scenario solves this problem as there is json file per scenario.

Additional context
Original feature example:
original scenario

Generated feature example:
generated scenario

As Background is just syntactic sugar for repeating steps, I am struggling to see the value here. Normally, the Cucable generated scenarios are just there for running the tests and less for human readability. In which case do you need to look at the generated scenarios?

Hi, thanks for response.

I am using reports which are generated as a result of test execution as part of Living Specification Documentation those are then shared with non-technical stakeholders.

Basically they are not looking exactly in generated scenarios, however, based on generated scenarios, json result files are created and after that we use CI tools which create reports based on those json results. So like that, the ordering of steps in Background and Feature, propagates to our reports and generated documents afterwards.

Hope, this gives some insight.

Ah I see, that makes sense. I don't know exactly when a next Cucable release will be happening as I am focussing on Cluecumber a lot but I will keep this in the backlog for the next one.

I am also looking for the same. And also the background should become optional in cluecumber report like hooks. It will be kool feature n will make report look compact.

In progress...

Done in 1.9.0 - release will happen during the next 30 minutes.

Thanks. It looks good now.

Thanks for confirming ๐Ÿ™‚