Skip to Content
Cucumber Cookbook
book

Cucumber Cookbook

by Shankar Garg
June 2015
Intermediate to advanced content levelIntermediate to advanced
162 pages
2h 59m
English
Packt Publishing
Content preview from Cucumber Cookbook

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 ...
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.
Start your free trial

You might also like

Cucumber Recipes

Cucumber Recipes

Ian Dees, Matt Wynne, Aslak Hellesoy
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths
Cucumber with the Java-Build Automation Framework with Minimal Code

Cucumber with the Java-Build Automation Framework with Minimal Code

Rahul Shetty, Venkatesh Chepuri (Rahul Shetty)
The Cucumber for Java Book

The Cucumber for Java Book

Seb Rose, Matt Wynne, Aslak Hellesoy

Publisher Resources

ISBN: 9781785286001Supplemental Content