Monday, February 27, 2017

What are Features and Step Definitions in Cucumber?

Features: File with “.feature” extension are called features file. A Feature file will contain one feature with one or more Scenarios. A line started with Keyword “Feature” in Feature file is the test feature that cucumber going to execute.  Each Scenario in Feature contains number of steps written using Gherkin language.

Step Definitions: Each step in a Scenario is mapped to Step definition. When Cucumber executes a Step Scenario it looks for a matching Step Definition to execute. Each step definition is a piece of code defined to do certain task in the scenario. Step definitions are attached to steps with a reference pattern, which is used for connecting steps in a scenario and step definitions.

No comments:

Post a Comment

Selenium4: Working with two parallel windows in Selenium Automation

A new method newWindow() is introduced in Selenium 4 (Alpha). Using this method we can open a new tab or new window from the current window...