Skip to content

Instantly share code, notes, and snippets.

@vitorebatista
Created May 10, 2019 23:51
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorebatista/d979332bb57c1ad17b031f7e3e0cd677 to your computer and use it in GitHub Desktop.
Save vitorebatista/d979332bb57c1ad17b031f7e3e0cd677 to your computer and use it in GitHub Desktop.
BDD - Login example with Cucumber
Feature: Login
I want to login on Keepfy
Background:
Given I go to '/login'
And the field 'email' is empty
And the field 'password' is empty
Scenario: Error on empty fields
When I click on 'enter'
Then field 'email' should be with error
And field 'password' should be with error
Scenario: Wrong password
When I type 'john.test@keepfy.com' in 'email'
And I type '123456' in 'password'
And I click on 'enter'
Then I should see 'E-mail or password is incorrect'
Scenario: Login successfully
Given I have users:
| name | email | password |
| Vitor Batista | vitor@keepfy.com | abcdef |
When I type 'vitor@keepfy.com' in 'email'
And I type 'abcdef' in 'password'
And I click on 'enter'
Then I shouldn't see 'Access your account'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment