A Mobile Application Testing Community
Gherkin is a language for describing business behavior without creating detailed implementations. Top software testing companies structure the scenarios as per their “Context”, “Action” and “Outcome”.
The scenarios are created using simple English language explaining the way a feature should behave as per the given situation.
The Gherkin test cases are created in feature files with an extension .feature and these are readable by BDD supported tools e.g., cucumber, Behat, etc.
Below are the best practices for writing Gherkin test cases:
Please refer example below:
Given the following user exists
| First Name | Last Name | Is SystemAdmin |CSV file|
| User | A | true |Test CSV |Test Doc |
And the CSV "Test CSV" file have valid data
And "User A" is logged in
And the user is on the "System" page
Scenario: Verification of uploaded data
When the user clicks the "Upload"
And the user selects "Option1" from the "detailed" drop down
And the user clicks "Choose File" and the user select "Test CSV"
Then the user should see name under the "Name" column
And the user should see type under the "Type" column
And the user should see Owner Email under the "Owner Email" column
And the user should see Errors under “Invalid” column