Skip to content

Gherkin

Ahmed Ali edited this page Jan 24, 2016 · 2 revisions

Cucumberish parses your .feature file which are written specification in a language called Gherkin.

Gherkin is plain-text English with a specific structure. It is designed to be easy to understand by non-technical guys; yet well structured to allow comprehensive expression of business rules in real-world manner.

Example feature written in Gherkin:

Feature: Profile
As a user I want to be able to create profile and update my details

Scenario: Create profile
    Given it is home screen
    When I tap the "Profile" button
    And I write "example@example.com" into the "Email" field
    Then I write "Ahmed Ali" into the "Name" field
    And I set the "Birthdate" picker date to "25-12-1990"
    And I tap "Save Profile" button
    Then I should see the text "Ahmed Ali" in the "Header" view

Every line that is not a blank line, has a meaning. Also Gherkin has some specific keywords.

Beside those obvious words, there are other symbols that has a meaning.

And the free text that appears directly under the feature name line is considered a feature description.

Clone this wiki locally