Creating the feature file
We begin with writing an example Cucumber feature file.
The Gherkin syntax that’s used to write features is characterized by the three words Given, When, and Then. These are analogous to the Arrange, Act, and Assert sections of all good unit tests, so they should feel familiar.
Let’s jump right in with our feature file and see what happens when we execute the test:
- Start by adding a new directory,
features
, with a newfeatures/birthdays.feature
file with the following content. It describes a user scenario in which the Birthdays application already supports editing a birthday. Here it is:Feature: Editing a birthday Scenario: Correcting the year of birth Given An existing birthday for "Hercules" on "1992-03-04" When I navigate to the "/birthdays" page And I edit the birthday for "...