First scenarios for my account : homepage and password change

This commit is contained in:
jjanvier 2013-06-02 21:24:27 +02:00
parent 96c780c903
commit 5b5b8e73af
3 changed files with 69 additions and 0 deletions

View 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"

View 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"

View file

@ -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$/
*/