Creating your first Step Definitions file

Now let's assume you are an automation developer and you have to implement automated test cases for a Feature file. The next Step in this direction would be to write the Step Definitions for this Feature file. So, how do we write Step Definitions in a Cucumber project? Let's see how to do this in this recipe.

How to do it…

The easiest way to create Step Definitions is to let Cucumber take care of it. The Steps are as follows:

  1. Here is the Feature file used in our previous chapter. Let's use this Feature file to create our first Step Definitions:
    Feature: login Page In order to test login page As a Registered user I want to specify the login conditions Scenario: checking pre-condition, action and results Given ...

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.