Cucumber reads executable specifications written in plain text and validates that the software does what those specifications say.
What is Gherkins:
Gherkins is a business readable domain specific language. It is a set of grammar rules that makes plain text structured enough for Cucumber to understand.
Example : Users are presented with Invalid Username/Password method when authentication fails
Scenarios:
Cucumber uses Scenarios to defines the steps . You describe the Scenarios using Given, When, And and Then, But
Example:
Scenario: Users are presented with Invalid Username/Password method when authentication fails
Given User is in the login page
when User fills the invalid username or password
And User hit the submit button
Then User see the pop up screen saying Invalid Username/PasswordWhen we define the Scenario, we can define multiple pre condition and multiple action and multiple expected outcomes.We can collapse these two or more similar scenarios into a Scenario Outline as followingScenario Outline: eating Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples: | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 |
(src: cucumber.io)
What is Feature and Feature File:
Feature can be defined as a standalone business functionality of a project. Feature file describes the testing needs for any features. A features file can contains one or many scenarios for you automated testings.In order the automatically detect the features by cucumber framework, you need to define it with .feature file extension. You will normally have a desperate feature file for each feature.
(This post is still in progress--- keep visit us again)