Add Step information in @BeforeStep and @AfterStep hook
See original GitHub issueCurrently, we can only access Scenario
level information in @BeforeStep
& @AfterStep
, it would be really great having step level information like, step name, line no, etc.
This will help to add implementation like, common step level log.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:33 (13 by maintainers)
Top Results From Across the Web
Cucumber Hooks - Baeldung
First, our two @Before hooks execute. Then before and after every step, the @BeforeStep and @AfterStep hooks run, respectively. Finally, the @ ...
Read more >After Step and before Step Cucumber - java - Stack Overflow
BeforeStep and AfterStep hooks are available in the latest cucumber jvm api. Just update your pom with the latest version for cucumber-jvm.
Read more >[cucumber-jvm] @BeforeStep and @AfterStep Usage example
So I want to get the step name and step status, and can be added to the ... Hook, like @BeforeStep and @AfterStep,...
Read more >What are Cucumber Hooks And How to Use ... - Tools QA
Cucumber supports hooks, which are blocks of code that run before or after each scenario. You can define them anywhere in your project...
Read more >Hooks - SpecFlow's documentation
In order to use hooks, you need to add the Binding attribute to your class: ... If you need to execute specific steps...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there a complete description somewhere what event contain what information and when they are are and so on for the plugin API? Maybe that’s not always clear, I personally just look at existing plugins and start a debugger to see whats going really on but if you have found your way its very powerful but have the following limitations:
on the other hand the proposed style:
makes it clear what happens here (no side-band communication) and is something that one intuitively would expect, why should a before-stepp hook should not know about the step?
Yes, I would agree with @bhreinb , why before_step can not be extended with additional information on a step, where its job is on step level. Then we should not inject the Scenario object as well.
My purpose in raising this request was, I want this step log information on the console log just for additional log information. Also, sometimes I faced, the runner goes into the infinite mode, but I don’t know where it was exactly stopped executing.
This will help in case we will not have a final report at all.