Search code examples
java-8cucumbercucumber-jvmgherkinselenide

Java 8 and Cucumber don't run the step files with lambdas methods


I have a great problem and I have tried to solve this problem, but all time is the same. I have this scenario with cucumber

feature file

And this is the steps' file

steps' file

Finally I run with

package Steps;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"./src/test/java/features"},
        glue = {"./src/test/java/Steps"},
        plugin = {"pretty", "html:reports/cucumber-html-report","json:cucumber.json"}
)
public class Orquestador {

}

And the consolo of intellij appear this:

ans

these are all my files Files

I am using Mac OS

Thanks :)


Solution

  • Cucumber is not finding your step definitions. Provide the correct "glue" to the location of your step definitions when running the feature file.