Search code examples
javacucumbercucumber-jvmcucumber-javacucumber-junit

Implement Cucumber "cucumber.api.java8.En" interface by step definition class


What is the purpose of implementing "cucumber.api.java8.En" interface by cucumber step definition classes?.


Solution

  • From Official Github page:

    Declare a step definition calling a method in the constructor of the glue class. For localized methods import the interface from io.cucumber.java8.<ISO2 Language Code>

    En stands for English, which is a public interface.

    public interface En extends LambdaGlue
    

    To execute steps in a feature file the steps must be connected to executable code. This can be done by implementing this interface (step-definitions to be written as Lambda expression).