Summary
In this chapter, you learned how to use Gherkin and Cucumber.js to write BDD features. This has been a long and hard chapter, because you not only needed to learn a new tool, Cucumber.js, but you also needed to build a set of utilities to make your life easier.
Always write features and scenarios in a language that makes sense and is understandable to the stakeholders. Avoid technical details, such as database structure, identifiers, or low-level operations, in your Gherkin.
It is a best practice to create a custom world object. The world object will be instantiated once before each scenario, so it is a good place to store any information that needs to be accessed by all the steps in the same scenario. In general, keep the code in the step ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access