What We Just Learned

Let’s review what we’ve talked about in this chapter:

  • We saw how the core Gherkin keywords Feature, Scenario, Given, When, and Then can be used to describe the behavior your stakeholders want as concrete examples.

  • There is a fundamental pattern to each Gherkin scenario, with a context (Given), an event (When), and an outcome (Then).

  • Each scenario must be capable of being run on its own and should not depend on data set up by other scenarios. This means every scenario has to include enough Given steps to set up all the data it needs.

  • You can add descriptions and comments to your .feature files to turn them into useful documentation of your system.

  • Using the #language: header, you can write your features in different ...

Get The Cucumber Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.