Testing / Cucumber Interview Questions
What is the Cucumber Runner in Java?
The runner is the entry point that tells the build tool (Maven, Gradle) and test framework (JUnit) how to discover and execute Cucumber scenarios. The current recommended approach in Cucumber-JVM uses the JUnit 5 Platform Suite engine rather than the older JUnit 4-style @RunWith(Cucumber.class) runner.
import org.junit.platform.suite.api.*; @Suite @IncludeEngines("cucumber") @SelectClasspathResource("features") @ConfigurationParameter(key = "cucumber.glue", value = "com.example.steps") @ConfigurationParameter(key = "cucumber.plugin", value = "pretty, html:target/cucumber-report.html") public class RunCucumberTest { }
This class typically has no test methods of its own; it's purely configuration that points the JUnit Platform at the feature files and glue code to run, and its configuration parameters control things like which formatters produce output, which tag expression filters the run, and how many scenarios run in parallel.
More Related questions...