Skip to content

Commit

Permalink
Provide post-CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Aug 19, 2023
1 parent 852f2db commit 1ed95f7
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 12 deletions.
15 changes: 14 additions & 1 deletion features/account/registering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 16 additions & 4 deletions features/checkout/registering_account_after_checkout.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Context/Api/EmailContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Context/Ui/EmailContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Behat/Context/Ui/Shop/RegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h1 class="ui icon header">
<i class="circular smile icon"></i>
<div class="content">
{{ 'sylius.ui.thank_you_for_register'|trans }}
{{ 'sylius.ui.thank_you_for_registration'|trans }}
<div class="sub header">{{ 'sylius.ui.verify_email_address'|trans }}</div>
</div>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down

0 comments on commit 1ed95f7

Please sign in to comment.