diff --git a/features/account/registering.feature b/features/account/registering.feature index 5e579e8e794d..ec78e1420476 100644 --- a/features/account/registering.feature +++ b/features/account/registering.feature @@ -7,7 +7,7 @@ Feature: Account registration Background: Given the store operates on a single channel in "United States" - @ui @api + @ui @no-api Scenario: Registering a new account with minimum information when channel has enabled registration verification Given on this channel account verification is required When I want to register a new account @@ -21,6 +21,19 @@ Feature: Account registration And I should be on registration thank you page But I should not be logged in + @api @no-ui + Scenario: Registering a new account with minimum information when channel has enabled registration verification + Given on this channel account verification is required + When I want to register a new account + And I specify the first name as "Saul" + And I specify the last name as "Goodman" + And I specify the email as "goodman@gmail.com" + And I specify the password as "heisenberg" + And I confirm this password + And I register this account + Then I should be notified that new account has been successfully created + But I should not be logged in + @ui @api Scenario: Registering a new account with minimum information when channel has disabled registration verification Given on this channel account verification is not required diff --git a/features/checkout/registering_account_after_checkout.feature b/features/checkout/registering_account_after_checkout.feature index d8f6a175d3c7..cafaee179809 100644 --- a/features/checkout/registering_account_after_checkout.feature +++ b/features/checkout/registering_account_after_checkout.feature @@ -11,9 +11,9 @@ Feature: Registering a new account after checkout And the store allows paying Offline @ui @no-api - Scenario: Registering a new account after checkout when channel has enabled registration verification + Scenario: Displaying thank you page after registration Given on this channel account verification is required - Given I have product "PHP T-Shirt" in the cart + And I have product "PHP T-Shirt" in the cart And I have completed addressing step with email "john@example.com" and "United States" based billing address And I have proceeded order with "Free" shipping method and "Offline" payment And I have confirmed order @@ -22,13 +22,25 @@ Feature: Registering a new account after checkout And I confirm this password And I register this account Then I should be on registration thank you page - When I verify my account using link sent to "john@example.com" + + @ui @no-api + Scenario: Registering a new account after checkout when channel has enabled registration verification + Given on this channel account verification is required + And I have product "PHP T-Shirt" in the cart + And I have completed addressing step with email "john@example.com" and "United States" based billing address + And I have proceeded order with "Free" shipping method and "Offline" payment + And I have confirmed order + When I proceed to the registration + And I specify a password as "sylius" + And I confirm this password + And I register this account + And I verify my account using link sent to "john@example.com" Then I should be able to log in as "john@example.com" with "sylius" password @ui @no-api Scenario: Registering a new account after checkout when channel has disabled registration verification Given on this channel account verification is not required - Given I have product "PHP T-Shirt" in the cart + And I have product "PHP T-Shirt" in the cart And I have completed addressing step with email "john@example.com" and "United States" based billing address And I have proceeded order with "Free" shipping method and "Offline" payment And I have confirmed order diff --git a/src/Sylius/Behat/Context/Api/EmailContext.php b/src/Sylius/Behat/Context/Api/EmailContext.php index 756649dfe8ac..64a3c6af6021 100644 --- a/src/Sylius/Behat/Context/Api/EmailContext.php +++ b/src/Sylius/Behat/Context/Api/EmailContext.php @@ -192,7 +192,7 @@ public function recipientShouldReceiveNoEmails(string $recipient): void } /** - * @Then only one email should have been sent to :recipientEmail + * @Then only one email should have been sent to :recipient */ public function onlyOneEmailShouldHaveBeenSentTo(string $recipient): void { diff --git a/src/Sylius/Behat/Context/Ui/EmailContext.php b/src/Sylius/Behat/Context/Ui/EmailContext.php index 5a61e4f83afa..584678fc6d72 100644 --- a/src/Sylius/Behat/Context/Ui/EmailContext.php +++ b/src/Sylius/Behat/Context/Ui/EmailContext.php @@ -189,7 +189,7 @@ public function recipientShouldReceiveNoEmails(string $recipient): void } /** - * @Then /^only one email should have been sent to "([^"]*)"$/ + * @Then only one email should have been sent to :recipient */ public function onlyOneEmailShouldHaveBeenSentTo(string $recipient): void { diff --git a/src/Sylius/Behat/Context/Ui/Shop/Checkout/RegistrationAfterCheckoutContext.php b/src/Sylius/Behat/Context/Ui/Shop/Checkout/RegistrationAfterCheckoutContext.php index 486c682fad7f..2230d671b095 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/Checkout/RegistrationAfterCheckoutContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/Checkout/RegistrationAfterCheckoutContext.php @@ -110,7 +110,7 @@ public function iShouldBeOnRegistrationThankYouPage(): void } /** - * @Then /^I should be on my account dashboard/ + * @Then I should be on my account dashboard */ public function iShouldBeOnMyAccountDashboard(): void { diff --git a/src/Sylius/Behat/Context/Ui/Shop/RegistrationContext.php b/src/Sylius/Behat/Context/Ui/Shop/RegistrationContext.php index 3dbd299fa9fd..86745e5ad4e7 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/RegistrationContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/RegistrationContext.php @@ -353,7 +353,7 @@ public function iShouldBeSubscribedToTheNewsletter(): void } /** - * @Then /^I should be on registration thank you page$/ + * @Then I should be on registration thank you page */ public function iShouldBeOnRegistrationThankYouPage(): void { @@ -362,7 +362,7 @@ public function iShouldBeOnRegistrationThankYouPage(): void } /** - * @Then /^I should be on my account dashboard$/ + * @Then I should be on my account dashboard */ public function iShouldBeOnMyAccountDashboard(): void { diff --git a/src/Sylius/Bundle/ShopBundle/Controller/RegistrationThankYouController.php b/src/Sylius/Bundle/ShopBundle/Controller/RegistrationThankYouController.php index f3b3a800c97d..967e7f690f6d 100644 --- a/src/Sylius/Bundle/ShopBundle/Controller/RegistrationThankYouController.php +++ b/src/Sylius/Bundle/ShopBundle/Controller/RegistrationThankYouController.php @@ -27,6 +27,7 @@ public function thankYouAction(): Response if ($channel->isAccountVerificationRequired()) { return new Response($this->twig->render('@SyliusShop/registerThankYou.html.twig')); } + return new RedirectResponse($this->router->generate('sylius_shop_account_dashboard')); } } diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/registerThankYou.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/registerThankYou.html.twig index 0069a518e587..95e81d662da7 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/registerThankYou.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/registerThankYou.html.twig @@ -9,7 +9,7 @@

- {{ 'sylius.ui.thank_you_for_register'|trans }} + {{ 'sylius.ui.thank_you_for_registration'|trans }}
{{ 'sylius.ui.verify_email_address'|trans }}

diff --git a/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml b/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml index 6f2978399ff8..246035b5f6cb 100644 --- a/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml +++ b/src/Sylius/Bundle/UiBundle/Resources/translations/messages.en.yml @@ -845,8 +845,8 @@ sylius: text: 'Text' textarea: 'Textarea' thank_you: 'Thank you!' + thank_you_for_registration: 'Thank you for your registration' thank_you_for_your_order: 'Thank you for your order' - thank_you_for_register: 'Thank you for your registration' the_instructions_below_will_be_displayed_to_the_customer: 'The instructions below will be displayed to the customer' the_page_you_are_looking_for_does_not_exist: 'The page you are looking for does not exist.' the_page_you_are_looking_for_is_forbidden: 'The page you are looking for is forbidden.'