mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
First scenarios for my account : homepage and password change
This commit is contained in:
parent
96c780c903
commit
5b5b8e73af
3 changed files with 69 additions and 0 deletions
13
features/frontend/account_homepage.feature
Normal file
13
features/frontend/account_homepage.feature
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Feature: User account homepage
|
||||
In order to access and manage my personal information
|
||||
As a logged user
|
||||
I want to be able to see my account homepage
|
||||
|
||||
Background:
|
||||
Given I am logged in user
|
||||
|
||||
Scenario: Viewing the homepage of my account
|
||||
Given I am on the store homepage
|
||||
When I follow "My account"
|
||||
Then I should be on my account homepage
|
||||
And I should see "Welcome to your space"
|
||||
40
features/frontend/account_password.feature
Normal file
40
features/frontend/account_password.feature
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
Feature: User account password change
|
||||
In order to enhance the security of my account
|
||||
As a logged user
|
||||
I want to be able to change password
|
||||
|
||||
Background:
|
||||
Given I am logged in user
|
||||
And I am on my account homepage
|
||||
|
||||
Scenario: Viewing my password change page
|
||||
Given I follow "My password"
|
||||
Then I should be on the account password page
|
||||
|
||||
Scenario: Changing my password with a wrong current password
|
||||
Given I am on the account password page
|
||||
When I fill in "CurrentPassword" with "wrongpassword"
|
||||
And I fill in "Password" with "newpassword"
|
||||
And I fill in "ConfirmationPassword" with "newpassword"
|
||||
And I press "Submit"
|
||||
Then I should still be on the account password page
|
||||
And I should see "The password you provided does not match the account you are logged in with"
|
||||
|
||||
Scenario: Changing my password with a confirmation password
|
||||
Given I am on the account password page
|
||||
When I fill in "CurrentPassword" with "password"
|
||||
And I fill in "Password" with "newpassword"
|
||||
And I fill in "ConfirmationPassword" with "wrongnewpassword"
|
||||
And I press "Submit"
|
||||
Then I should still be on the account password page
|
||||
And I should see "The new password does not match the confirmation"
|
||||
|
||||
Scenario: Successfully changing my password
|
||||
Given I am on the account password page
|
||||
When I fill in "CurrentPassword" with "password"
|
||||
And I fill in "Password" with "newpassword"
|
||||
And I fill in "ConfirmationPassword" with "newpassword"
|
||||
And I press "Submit"
|
||||
Then I should still be on the account password page
|
||||
And I should see "Your password has been changed"
|
||||
|
||||
|
|
@ -119,6 +119,22 @@ class WebUser extends MinkContext implements KernelAwareInterface
|
|||
$this->getSession()->visit($this->generateUrl('sylius_homepage'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^I am on my account homepage$/
|
||||
*/
|
||||
public function iAmOnMyAccountHomepage()
|
||||
{
|
||||
$this->getSession()->visit($this->generateUrl('sylius_account'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^I should be on my account homepage$/
|
||||
*/
|
||||
public function iShouldBeOnMyAccountHomepage()
|
||||
{
|
||||
$this->assertSession()->addressEquals($this->generateUrl('sylius_account'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^I should be on login page$/
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue