Skip to content

Instantly share code, notes, and snippets.

@pragmatictesters
Created July 9, 2022 04:33
Show Gist options
  • Save pragmatictesters/06d241aad53644fb74c023ad6d909f43 to your computer and use it in GitHub Desktop.
Save pragmatictesters/06d241aad53644fb74c023ad6d909f43 to your computer and use it in GitHub Desktop.
Sample feature file
Feature: Login feature
Scenario: Login as a standard user
Given User has accessed the login page "https://www.saucedemo.com"
When User type username "standard_user"
And User type password "secret_sauce"
And User click the login button
Then User should be directed to inventory page "https://www.saucedemo.com/inventory.html"
Scenario: Standard user login with invalid password
Given User has accessed the login page "https://www.saucedemo.com"
When User type username "standard_user"
And User type password "secret_invalid"
And User click the login button
Then User should see error "Epic sadface: Username and password do not match any user in this service"
Scenario Outline: User login with invalid inputs
Given User has accessed the login page "https://www.saucedemo.com"
When User type username "<user_name>"
And User type password "<password>"
And User click the login button
Then User should see error "<expected_error>"
Examples:
| user_name | password | expected_error |
| standard_user | secret_invalid | Epic sadface: Username and password do not match any user in this service |
| standard_user | | Epic sadface: Password is required |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment