Testing / Cucumber Interview Questions
Explain the execution flow of a Cucumber scenario from feature file to step definition?
Running a Cucumber suite involves several distinct phases: discovering feature files, compiling them into executable pickles, and then matching and invoking the right code for each step of each pickle.
Discovery and compilation happen once, up front, turning every Scenario and every expanded Scenario Outline row into an independent pickle. For each pickle, Cucumber runs applicable @Before hooks, then processes steps one at a time: matching the step's text against every registered step definition's pattern, and failing immediately with an error if zero or more than one definition matches. Only after every step in the pickle completes (or one fails) do the @After hooks run, and the final pass/fail result is reported back to the runner.
More Related questions...