Currently in our project's tests we switched from using annotated step definitions, e.g.:
public class Steps {
@Given("^Step name$")
void methodName() {
// do sth
}
}
to lambda expressions:
public class Steps implements En {
public Steps() {
Given("^Step name$", () ->
// do sth
);
}
}
When using Intellij Cucumber Java plugin it was easy to find the usage of some step, since it looked for usages of the annotated method (I presume). Now however, we have to manually search for the regex passed as the argument.
My first question is: is there a neat way to do this with lambda expressions?
Moreover: when using Intellij's tool for version control and commiting files containing definitions of big numbers of steps, the code analysis tool goes on forever (I guess it is because of the constructor having to crank a lot of code).
So the second question is: since there is no possibility of the step library shrinking and step usage search is used very often wouldn't it be a good idea to switch back to Ye Olde Way i.e. using annotated methods?
Find usages for java-8 style step definitions do not yet work. One can vote and follow this request: IDEA-144648.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With