2018-12-12 20:46:24 -05:00
|
|
|
|
Feature: Password change
|
2018-12-13 18:17:03 -05:00
|
|
|
|
Background:
|
2018-12-12 20:46:24 -05:00
|
|
|
|
Given I am signed in with email "user@example.com" and password "password"
|
2018-12-13 18:17:03 -05:00
|
|
|
|
|
|
|
|
|
Scenario: with valid credentials
|
2018-12-12 20:46:24 -05:00
|
|
|
|
When I visit "/users/edit"
|
|
|
|
|
And I fill form with the following data:
|
|
|
|
|
| key | value |
|
|
|
|
|
| Пароль | q1w2e3r4 |
|
|
|
|
|
| Подтверждение пароля | q1w2e3r4 |
|
|
|
|
|
| Текущий пароль | password |
|
|
|
|
|
And I click the form button "Обновить"
|
|
|
|
|
Then the password is successfully changed
|
2018-12-12 21:00:30 -05:00
|
|
|
|
And I received password change email as "user@example.com"
|
2018-12-12 20:46:24 -05:00
|
|
|
|
|
|
|
|
|
When I try to sign out
|
|
|
|
|
Then I am successfully signed out
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "password"
|
|
|
|
|
Then I fail to sign in
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "q1w2e3r4"
|
|
|
|
|
Then I am signed in as "user@example.com"
|
2018-12-13 18:17:03 -05:00
|
|
|
|
|
|
|
|
|
Scenario: with invalid password
|
|
|
|
|
When I visit "/users/edit"
|
|
|
|
|
And I fill form with the following data:
|
|
|
|
|
| key | value |
|
|
|
|
|
| Пароль | q1w2e3r4 |
|
|
|
|
|
| Подтверждение пароля | q1w2e3r4 |
|
|
|
|
|
| Текущий пароль | invalid |
|
|
|
|
|
And I click the form button "Обновить"
|
|
|
|
|
Then the password is failed to change
|
2018-12-13 18:20:07 -05:00
|
|
|
|
And I see text "Текущий пароль имеет неверное значение"
|
2018-12-13 18:17:03 -05:00
|
|
|
|
|
|
|
|
|
When I try to sign out
|
|
|
|
|
Then I am successfully signed out
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "q1w2e3r4"
|
|
|
|
|
Then I fail to sign in
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "password"
|
|
|
|
|
Then I am signed in as "user@example.com"
|
2018-12-13 18:20:07 -05:00
|
|
|
|
|
|
|
|
|
Scenario: with invalid password confirmation
|
|
|
|
|
When I visit "/users/edit"
|
|
|
|
|
And I fill form with the following data:
|
|
|
|
|
| key | value |
|
|
|
|
|
| Пароль | q1w2e3r4 |
|
|
|
|
|
| Подтверждение пароля | invalid |
|
|
|
|
|
| Текущий пароль | password |
|
|
|
|
|
And I click the form button "Обновить"
|
|
|
|
|
Then the password is failed to change
|
|
|
|
|
And I see text "Подтверждение пароля не совпадает со значением поля Пароль"
|
|
|
|
|
|
|
|
|
|
When I try to sign out
|
|
|
|
|
Then I am successfully signed out
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "q1w2e3r4"
|
|
|
|
|
Then I fail to sign in
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "invalid"
|
|
|
|
|
Then I fail to sign in
|
|
|
|
|
|
|
|
|
|
When I try to sign in with email "user@example.com" and password "password"
|
|
|
|
|
Then I am signed in as "user@example.com"
|