A Mobile Application Testing Community
In Cucumber, test cases are written in Gherkin syntax.
Gherkin tests are structured by test automation services for defining the scenario using simple English language.
Below are the steps followed while creating Gherkin:
The scenarios should be developed using Given, Event and Result. The Gherkin steps are defined using the keywords “Given”, “When” and “Then”.
The “Given” should defined pre-requisites and “When” defines the test actions.
“Then” declares the verification step and “AND” is used to declare multiple steps between “Given”, “When” and “Then”.
“Feature” or “Scenario” tags are implemented with “@” for reusability.
Background is executes before every scenario declared in the feature file.
Below is the Gherkin Syntax:
Given the following user exists
| First Name | Last Name | Is Admin |CSV file|
| User | U1 | true | CSVfile1 |
And the CSV " CSVfile1" file have valid data
And "User U1" is logged in
And the user is on the "TestingModule" page
Scenario: Verification of uploaded data on TestingModule page
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 "CSVfile1"
Then the user should see name under the "Name" column
And the user should see emailid under the "Email" column
And the user should see Errors under “Invalid” column