Testing / Cucumber Interview Questions
What is glue code in Cucumber?
"Glue" is Cucumber's own term for the code that connects, or "glues", Gherkin steps to their executable implementations: step definitions and hooks together. The term shows up directly in configuration, such as the glue path setting that tells Cucumber which package to scan for this code.
@Suite @IncludeEngines("cucumber") @SelectClasspathResource("features") @ConfigurationParameter(key = "cucumber.glue", value = "com.example.steps") public class RunCucumberTest { }
Without correctly configured glue, Cucumber has no way to find the step definitions and hooks that exist in the codebase, even if they're written correctly, which is a common source of "step not found" errors early in setting up a new Cucumber project: the code exists, but Cucumber was never told where to look for it.
More Related questions...