Loose step matching, not based on StepType



I've recently started working with jbehave, and I am noticing duplication when a step method can be more than one StepType, e.g.:

An easy workaround could be to support the following syntax

i.e. in case a method has multiple StepType annotations, only one value needs to be not empty.

But I think there's a more elegant solution.
The Cucumber Book says something interesting about this:

Given, When, Then Are the Same.
It doesn't actually matter which of the three methods you use to register a step definition, because Cucumber ignores the keyword when matching a step. Under the hood, all of the keyword methods are aliases for Cucumber:: RbDsl#register_rb_step_definition. The keywords are really just there for extra documentation to help you express the intent of each step or step definition.
This means that, whether it was created with the method Given, When, or Then, a step definition will match any Gherkin step as long as the regular expression matches the main text of the step

I like this concept. At the end of the day, a step is just a method that I may want to call at a certain point (as the m-th or the n-th step) in a scenario.

Well, different story for given's vs. then's.
Given my cart is empty != Then my cart is empty
But, as the cucumber book suggests, then steps should be reworded to use "should"
=> "then my cart should be empty"

So what about going a little bit farther and defining a generic @Step annotation?

There is a problem, though, as I think this would break .
But then, as far as I understand, the ultimate solution would be to support regexes, wouldn't it? Which is another feature that would be a very-nice-to-have, I think.





Alberto Scotto