forked from Sylius/Sylius
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Sylius#7406 from Arminek/order-shipping-method-int…
…egirty-validation [Checkout] Order shipping method integrity validation
- Loading branch information
Showing
39 changed files
with
1,057 additions
and
36 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
features/checkout/order_promotion/order_promotion_integrity_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@checkout | ||
Feature: Order promotions integrity | ||
In order to have valid promotions applied on my order | ||
As a Customer | ||
I want to have information about promotion changes on my order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store allows paying offline | ||
And the store ships everywhere for free | ||
And the store has a product "PHP T-Shirt" priced at "$100.00" | ||
And there is a promotion "Christmas sale" | ||
And this promotion gives "$10.00" discount to every order | ||
And this promotion expires tomorrow | ||
And I am a logged in customer | ||
|
||
@ui | ||
Scenario: Preventing customer from completing checkout with already expired promotion | ||
Given I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Offline" payment method | ||
And this promotion has already expired | ||
When I confirm my order | ||
Then I should be informed that this promotion is no longer applied | ||
And I should not see the thank you page |
54 changes: 54 additions & 0 deletions
54
features/checkout/paying_for_order/inform_customer_about_order_total_changes.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@paying_for_order | ||
Feature: Inform customer about any order total changes during checkout process | ||
In order inform the customer about any changes that affect order total | ||
As a Customer | ||
I want to be able prevent placing order with invalid order total | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has "NA VAT" tax rate of 23% for "Clothes" within the "US" zone | ||
And the store has a product "PHP T-Shirt" priced at "$19.99" | ||
And it belongs to "Clothes" tax category | ||
And the store ships everywhere for free | ||
And the store allows paying offline | ||
|
||
@ui | ||
Scenario: Inform customer about order total change due to product price change | ||
Given I am a logged in customer | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Offline" payment method | ||
And this product price has been changed to "$25.00" | ||
When I confirm my order | ||
Then I should be informed that order total has been changed | ||
And I should not see the thank you page | ||
|
||
@ui | ||
Scenario: Be able to confirm order after information appears | ||
Given I am a logged in customer | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Offline" payment method | ||
And this product price has been changed to "$25.00" | ||
And I have confirmed order | ||
When I confirm my order | ||
Then I should see the thank you page | ||
|
||
@ui | ||
Scenario: Inform customer about order total change due to tax change | ||
Given I am a logged in customer | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have proceeded selecting "Offline" payment method | ||
And the "NA VAT" tax rate has changed to 10% | ||
When I confirm my order | ||
Then I should be informed that order total has been changed | ||
And I should not see the thank you page | ||
|
||
@ui | ||
Scenario: Inform customer about order total change due to shipping method fee change | ||
Given the store has "UPS" shipping method with "$20.00" fee | ||
And I added product "PHP T-Shirt" to the cart | ||
And I have completed addressing step with email "guest@example.com" and "United States" based shipping address | ||
And I have proceeded order with "UPS" shipping method and "Offline" payment | ||
And the shipping fee for "UPS" shipping method has been changed to "$30.00" | ||
When I confirm my order | ||
Then I should be informed that order total has been changed | ||
And I should not see the thank you page |
21 changes: 21 additions & 0 deletions
21
features/checkout/paying_for_order/payment_method_integrity_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@paying_for_order | ||
Feature: Order payment method integrity | ||
In order to have valid payment method | ||
As a Customer | ||
I want to have valid order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "PHP T-Shirt" priced at "$19.99" | ||
And the store ships everywhere for free | ||
And the store allows paying offline | ||
And I am a logged in customer | ||
|
||
@ui | ||
Scenario: Preventing customer from completing checkout with no longer available payment method | ||
Given I have product "PHP T-Shirt" in the cart | ||
And I have proceeded selecting "Offline" payment method | ||
But this payment method has been disabled | ||
When I confirm my order | ||
Then I should be informed that this payment method has been disabled | ||
And I should not see the thank you page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@paying_for_order | ||
Feature: Order products integrity | ||
In order to have valid products | ||
As a Customer | ||
I want to have enabled products in my order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "PHP T-Shirt" priced at "$19.99" | ||
And the store ships everywhere for free | ||
And the store allows paying offline | ||
And I am a logged in customer | ||
|
||
@ui | ||
Scenario: Preventing customer from completing checkout with no longer available products | ||
Given I have product "PHP T-Shirt" in the cart | ||
And I have proceeded selecting "Offline" payment method | ||
But this product has been disabled | ||
When I confirm my order | ||
Then I should be informed that this product has been disabled | ||
And I should not see the thank you page |
50 changes: 50 additions & 0 deletions
50
features/checkout/shipping_order/shipping_method_integrity_validation.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@checkout | ||
Feature: Order shipping method integrity | ||
In order to have valid shipping method on my order | ||
As a Visitor | ||
I want to have valid order | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has "Heavy stuff" shipping category | ||
And the store has "Small stuff" shipping category | ||
And the store allows paying offline | ||
And the store allows shipping with "DHL" | ||
And this shipping method requires that all units match to "Heavy stuff" shipping category | ||
And the store allows shipping with "FedEx" | ||
And this shipping method requires at least one unit matches to "Small stuff" shipping category | ||
And the store has a product "Westworld host" priced at "$12.54" | ||
And this product belongs to "Heavy stuff" shipping category | ||
And the store has a product "T-shirt Breaking Bad" priced at "$12.54" | ||
And this product belongs to "Small stuff" shipping category | ||
|
||
@ui | ||
Scenario: Validate shipping method after adding item which does not fit shipping method requirements | ||
Given I added product "Westworld host" to the cart | ||
And I have completed addressing step with email "guest@example.com" and "United States" based shipping address | ||
And I have proceeded order with "DHL" shipping method and "Offline" payment | ||
When I add product "T-shirt Breaking Bad" to the cart | ||
And I want to complete checkout | ||
Then I should not be able to confirm order because products does not fit "DHL" requirements | ||
And I should not see the thank you page | ||
|
||
@ui @javascript | ||
Scenario: Validate shipping method after removing item which fits shipping method requirements | ||
Given I added product "T-shirt Breaking Bad" to the cart | ||
And I added product "Westworld host" to the cart | ||
And I have completed addressing step with email "guest@example.com" and "United States" based shipping address | ||
And I have proceeded order with "FedEx" shipping method and "Offline" payment | ||
When I remove product "T-shirt Breaking Bad" from the cart | ||
And I want to complete checkout | ||
Then I should not be able to confirm order because products does not fit "FedEx" requirements | ||
And I should not see the thank you page | ||
|
||
@ui | ||
Scenario: Validate shipping method after administrator changes shipping method requirements | ||
Given I added product "Westworld host" to the cart | ||
And I have completed addressing step with email "guest@example.com" and "United States" based shipping address | ||
And I have proceeded order with "DHL" shipping method and "Offline" payment | ||
And product "Westworld host" shipping category has been changed to "Small stuff" | ||
When I want to complete checkout | ||
Then I should not be able to confirm order because products does not fit "DHL" requirements | ||
And I should not see the thank you page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.