Is there a way to list all Cucumber step definitions

Viewed 215

The list of all of the expressions of Step Definitions (methods with @Given @When or @Then annotations) effectively defines the ubiquitous language that is available to be used to write Steps within Scenarios.

I have found myself loosing track of existing Step Definitions, and I have created different variants of existing Step Definitions with slightly different expressions. I have had to go back and refactor a number of times to eliminate duplicates. If only I had known about the original Step Definition in the first place ...

Is there an automated way of getting a list of all Step Definition expressions, preferably separated by the class they are in?

The expressions from annotations are what I specifically need, but bonus if it also works using Java 8 lambda means of defining Step Definitions.

0 Answers
Related