Skip to content
Advertisement

How do I get the name of the Scenario step currently executing?

I’m logging the currently executing Scenario in a hook like so:

JavaScript

But, how do I get the name of the Step? I mean, the Given, When, Then lines.

Advertisement

Answer

You would need to implement the ConcurrentEventListener interface and setup the handlers for the event you are looking for, in your case the TestStepStarted event

JavaScript

Then implement the method handTestStepStarted

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement