Cucumber is a testing tool that is based on Behavior Driven Development (BDD) methodology. The main aim of Behavior Driven Development framework is to make various project roles such as Business Analysts, Quality Assurance, Developers etc., understand the application without diving deep into the technical aspects.
Following are the key features of Cucumber:
● Cucumber is an open source testing tool.
● Automation test cases developed using the Cucumber tool are easier to maintain and understand as well.
● Plain Text representation makes it easier for non-technical users to understand the scenarios.
● It bridges the communication gap between various project stakeholders such as Business Analysts, Developers, and Quality Analyst personnel.
● Cucumber is easy to integrate with other tools such as Selenium and Capybara.
Gherkin is the language that is being used by the Cucumber testing tool. It is a simple English representation of the application behavior. Gherkin language uses several keywords to describe the behavior of application such as Feature, Scenario, Scenario Outline, Given, When, Then etc.
Cucumber testing tool provides support for multiple programming languages such as Java, .Net, Ruby etc.
A feature file can contain a maximum of 10 scenarios, but the number can vary from project to project and from one organization to another.
Background keyword is used to group multiple given statements into a single group.
File Extension for a feature file is .feature. A feature file is ideally written in a notepad file and is saved with the extension feature.
Cucumber Options tag is used to provide a link between the feature files and step definition files. Each step of the feature file is mapped to a corresponding method on the step definition file.
Here is the syntax:
Following Cucumber JARs can be used for integration:
Cucumber Natural Plugin is the plugin that is used to integrate Eclipse with Cucumber.
TestRunner class is used to provide the link between feature file and step definition file.
When integrated with Selenium, the starting point of execution must be from TestRunner class.