Chapter 2. Creating Step Definitions

In this chapter, we will cover the following topics:

  • Creating your first Step Definitions file
  • Identifying duplicate and Ambiguous Step Definitions
  • Using regular expressions to optimize Step Definitions
  • Using Optional Capture/Noncapture groups
  • Transforming Data Tables to parse the test data
  • Implementing Data Table diffs to compare tables
  • Using Doc Strings to parse big data as one chunk
  • Combining Doc Strings and Scenario Outlines
  • Defining String transformations for better conversions

Introduction

Sometimes people who are not that well versed in Cucumber argue that creating a Step Definitions file is an overhead as compared to the frameworks that do not have Cucumber. But what they don't realize is that Cucumber auto-generates ...

Get Cucumber Cookbook 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.