- SpecFlow Tutorial
- SpecFlow - Home
- SpecFlow - Introduction
- Test Driven Development
- Behaviour Driven Development
- SpecFlow - Visual Studio Installation
- Visual Studio Extension Installation
- SpecFlow - Project Set Up
- Other Project Dependencies
- SpecFlow - Runner Activation
- SpecFlow - HTML Reports
- SpecFlow - Binding Test Steps
- SpecFlow - Creating First Test
- Configure Selenium Webdriver
- SpecFlow - Gherkin
- SpecFlow - Gherkin Keywords
- SpecFlow - Feature File
- SpecFlow - Step Definition File
- SpecFlow - Hooks
- SpecFlow - Background Illustration
- Data Driven Testing with Examples
- Data Driven Testing without Examples
- Table conversion to Data Table
- Table conversion to Dictionary
- Table with CreateInstance
- SpecFlow - Table with CreateSet
- SpecFlow Useful Resources
- SpecFlow - Quick Guide
- SpecFlow - Useful Resources
- SpecFlow - Discussion
SpecFlow - Gherkin
A Gherkin is a group of important keywords to build a meaningful architecture for specifications. Every keyword is converted to plain spoken languages like English.
Rules in Gherkin
Some of the rules in Gherkin are listed below −
A document in Gherkin begins with keywords.
Comments can be added at the beginning of the new line in the Feature File. They start with or without spaces followed by # symbol and text. However, block comments cannot be added till now in SpecFlow.
To indent the code, spaces or tabs can be used. It is recommended to have two spaces for indentation.
The content after the keyword for each step has a corresponding block of code. This is known as the Step Definition.
Gherkin Example
Following is the Gherkin example −
Feature: Payment Functionality # Example 1 Scenario: Member Payment Method When a member is on Payment screen Then the payment amount is displayed. # Example 2 Scenario: Member Payment Dues When a member is on Payment Due screen Then the payable amount is displayed.
In the above example, Feature, Scenario, Given, When, and Then are known as the Gherkin keywords.