diff --git a/features/frontend/user_login.feature b/features/frontend/user_login.feature index 19113d99a7..d0cb23ce18 100644 --- a/features/frontend/user_login.feature +++ b/features/frontend/user_login.feature @@ -5,15 +5,15 @@ Feature: Sign in to the store Background: Given there are following users: - | username | password | enabled | - | bar | foo | yes | + | email | password | enabled | + | bar@foo.com | foo | yes | Scenario: Log in with username and password Given I am on the store homepage And I follow "Login" When I fill in the following: - | Login | bar | - | Password | foo | + | Email | bar@foo.com | + | Password | foo | And I press "Login" Then I should be on the store homepage And I should see "Logout" @@ -22,8 +22,8 @@ Feature: Sign in to the store Given I am on the store homepage And I follow "Login" When I fill in the following: - | Login | bar | - | Password | bar | + | Email | bar@foo.com | + | Password | bar | And I press "Login" Then I should be on login page And I should see "Bad credentials" @@ -32,7 +32,7 @@ Feature: Sign in to the store Given I am on the store homepage And I follow "Login" When I fill in the following: - | Login | john | + | Email | john | | Password | bar | And I press "Login" Then I should be on login page diff --git a/src/Sylius/Bundle/WebBundle/Behat/DataContext.php b/src/Sylius/Bundle/WebBundle/Behat/DataContext.php index 279208904a..7188c02202 100644 --- a/src/Sylius/Bundle/WebBundle/Behat/DataContext.php +++ b/src/Sylius/Bundle/WebBundle/Behat/DataContext.php @@ -133,7 +133,7 @@ class DataContext extends BehatContext implements KernelAwareInterface foreach ($table->getHash() as $data) { $this->thereIsUser( - $data['username'], + $data['email'], isset($data['password']) ? $data['password'] : $this->faker->word(), 'ROLE_USER', isset($data['enabled']) ? $data['enabled'] : true @@ -141,11 +141,10 @@ class DataContext extends BehatContext implements KernelAwareInterface } } - public function thereIsUser($username, $password, $role = null, $enabled = 'yes') + public function thereIsUser($email, $password, $role = null, $enabled = 'yes') { $user = new User(); - $user->setUsername($username); - $user->setEmail($this->faker->email()); + $user->setEmail($email); $user->setEnabled('yes' === $enabled); $user->setPlainPassword($password);