Friday 6 August 2021

What is Cucumber Testing?

 Cucumber is an open source software testing tool. It supports BDD(Behavior Driven Development) approach. It is written in Ruby Programming language. Cucumber supports various programming languages like Java, .Net, Javascript, PHP. This tool helps entire testing team to understand automation in simple way. Cucumber tool helps to write test cases that everybody can understand.

What is Feature File?

Feature file contains high level description of  Test Scenario. All the feature files have .feature extension. It contains code written in Gherkin

Sample Feature File :
Feature : Login Functionality.

Scenario : Login to application with valid credentials.
When user enters with valid credentials
And click on Login Button
Then Home page should be displayed.

Scenario : Login to application with invalid credentials.
When user enters invalid credentials
And click on Login Button
Then Error message should be displayed.

What is Step Definition File?

This file contains the actual code written by programmer. It maps the steps in the scenario with the code written. Step definitions can be written in various programming languages. When cucumber executes a step in feature file a corresponding function in step definition file is called.  

The BDD life cycle consists of following steps :

1.Behavior Description.

2.Step Definition.

3.Run and Fail.

4.Modify Code

5.Run and Pass.