1

I need to print the step and scenario for a sense to know which scenario and step is currently in execution. Currently, 3-4 steps' output is printed and the steps are printed in bulk after a scenario finishes. This makes it very hard to understand exactly where a step has ended and other has begun.

Perhaps an annotation/option that can enable printing of the step-language (i.e. the text after the When/Then etc. workds) right before it begins along with a horizontal marker would be great.

Example:

1) Current:

INFO: Doing a
INFO: Doing b
INFO: Doing c
INFO: Doing x
INFO: Doing y
  Scenario: Do several things
     Given a,b,c things
     And x,y things

2) Desired:

  Scenario: Do several things
     Given a,b,c things
INFO: Doing a
INFO: Doing b
INFO: Doing c

  Scenario: Do several things
     And x,y things
INFO: Doing x
INFO: Doing y

// Perhaps a summary in the end is fine (as happening currently)
  Scenario: Do several things
     Given a,b,c things
     And x,y things

Someone asked the question couple years back: http://grokbase.com/t/gg/cukes/144anjrgjf/cucumber-print-scenario-and-step-before-it-is-executed-on-the-console

But I was expecting to see some library-provision built in these years.

user2250246
  • 3,807
  • 5
  • 43
  • 71
  • possible dup of : http://stackoverflow.com/questions/39664422/in-cucumber-is-it-possible-to-programmatically-get-the-current-step-being-execu/39686624#39686624 http://stackoverflow.com/questions/23602953/how-to-get-name-of-scenario-in-cucumber-java – Sid Sep 30 '16 at 22:00
  • I know that when running cucumber through Intellij, it outputs the step name right after it finishes that step. It's been a while since I used the CLI, but I was under the impression that it did the same thing. If you aren't seeing that, it's possible that the buffer is causing your issue. http://stackoverflow.com/questions/29998728/what-stdout-sync-true-means – Tyler MacMillan Oct 01 '16 at 14:49
  • I want to print the step before it begins execution so that I know what step is executing currently. I ended adding a `logger.info("STEP: blah")` to all my steps :( – user2250246 Oct 01 '16 at 18:10

0 Answers0