In previous post we had an overview of the Cucumber, Gherkin & feature file. Now let's see how to write test cases in feature files using Gherkin. Anatomy of a feature-file All non-blank lines in a feature file have to start with a valid Gherkin keyword. Some of them we discussed in the previous post. Here is the description of the main Gherkin keywords. Feature: The first Keyword in feature-file must be Feature, it must be followed by : After Feature: cucumber ignores all the text and lines for processing until a line starting with either Scenario , Background, or Scenario Outline keyword is found. All the text in between is used only for reporting purposes. The first line is used as the feature name, and the remaining lines (if present) are used as feature descriptions. Scenario: Scenario keyword must also be followed by : . Any text after : in this ...
Explore more at my website