Feature File in Specflow framework

A Feature File is a simple plain text file containing feature description, scenarios, and steps to test the feature. It is an entry point for writting test.

Feature files can be written using a text editor (such as Notepad++) or by using a code editor. The purpose of the Feature keyword is to provide a high-level description of the functionality and it related scenarios. The first keyword in a Gherkin document must always be Feature, followed by a : and a short text that describes the feature.

A typical feature file will include:

Description of the feature 

Scenarios , Scenario Outline

Background

Given, When, Then, And, But 

We can only have a single Feature in a .feature file.

Example:

Deposit.feature 

Feature: Deposit Feature
  Verify user deposit the money in the account
  
Scenario: Verify user login and deposit the amount
    Given the user record is created
    When user login to the application
    And user navigates to the Deposit page
    Then user deposit the amount

 

Related Tutorials