From 080c0cac50fc967d73ff2df5728a66f0284ca3ba Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Thu, 5 Sep 2024 12:50:41 +0200 Subject: [PATCH] [Behat][Checkout] Enable shipping step tests --- ...ing_able_to_modify_remaining_steps.feature | 4 +-- ..._the_locale_other_than_the_default.feature | 2 +- ...es_get_updated_throughout_checkout.feature | 4 +-- ...vailable_shipping_method_selection.feature | 14 ++++----- ...rder_with_disabled_shipping_method.feature | 4 +-- ...mpletion_without_a_selected_method.feature | 15 +++++---- ...m_shipping_step_to_addressing_step.feature | 4 +-- ...selected_based_on_shipping_address.feature | 4 +-- .../seeing_shipping_fee.feature | 4 +-- ..._shipping_fee_on_multiple_channels.feature | 4 +-- ...l_units_match_to_shipping_category.feature | 10 +++--- ..._one_unit_match_to_shipping_method.feature | 10 +++--- ...o_units_match_to_shipping_category.feature | 24 +++++++------- .../selecting_order_shipping_method.feature | 2 +- ...ipping_method_integrity_validation.feature | 2 +- .../sorting_shipping_method_selection.feature | 2 +- ...any_shipping_and_its_total_is_zero.feature | 2 +- ...y_one_shipping_method_is_available.feature | 6 ++-- ...rder_does_not_require_any_shipping.feature | 4 +-- ...ying_correct_shipping_fee_on_order.feature | 6 ++-- ...ng_fee_with_product_taxes_on_order.feature | 4 +-- ...t_shipping_fee_with_taxes_on_order.feature | 4 +-- ...shipping_cost_based_on_items_total.feature | 4 +-- ...hipping_cost_based_on_total_weight.feature | 4 +-- ...pping_methods_based_on_items_total.feature | 6 ++-- ...ms_total_with_taxes_and_promotions.feature | 6 ++-- ...ping_methods_based_on_total_weight.feature | 6 ++-- ...ds_based_on_channel_as_a_shop_user.feature | 4 +-- ...hods_based_on_channel_as_a_visitor.feature | 4 +-- .../Shop/Checkout/CheckoutShippingContext.php | 3 ++ .../Page/Shop/Checkout/SelectShippingPage.php | 31 ++++++------------- 31 files changed, 96 insertions(+), 107 deletions(-) diff --git a/features/shop/checkout/being_able_to_modify_remaining_steps.feature b/features/shop/checkout/being_able_to_modify_remaining_steps.feature index 4fcb148ce0..2cd714941d 100644 --- a/features/shop/checkout/being_able_to_modify_remaining_steps.feature +++ b/features/shop/checkout/being_able_to_modify_remaining_steps.feature @@ -22,7 +22,7 @@ Feature: Changing checkout steps And I complete the addressing step Then I should be on the checkout shipping step - @no-api @todo-ui + @no-api @ui @javascript Scenario: Addressing my order after selecting payment method Given I had product "PHP T-Shirt" in the cart And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" @@ -32,7 +32,7 @@ Feature: Changing checkout steps And I complete the addressing step Then I should be on the checkout shipping step - @no-api @todo-ui + @no-api @ui @javascript Scenario: Addressing my order after selecting shipping method Given I had product "PHP T-Shirt" in the cart And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" diff --git a/features/shop/checkout/picking_up_the_cart_with_the_locale_other_than_the_default.feature b/features/shop/checkout/picking_up_the_cart_with_the_locale_other_than_the_default.feature index bbc023b2ff..27ce6402b4 100644 --- a/features/shop/checkout/picking_up_the_cart_with_the_locale_other_than_the_default.feature +++ b/features/shop/checkout/picking_up_the_cart_with_the_locale_other_than_the_default.feature @@ -22,7 +22,7 @@ Feature: Picking up the cart with the locale other than the default And I check details of my cart Then my cart's locale should be "French (France)" - @todo @api @no-ui + @api @no-ui Scenario: Picking up the cart with non valid locale When I pick up cart using wrong locale And I check details of my cart diff --git a/features/shop/checkout/prices_get_updated_throughout_checkout.feature b/features/shop/checkout/prices_get_updated_throughout_checkout.feature index 41df918b8b..35e2d21de8 100644 --- a/features/shop/checkout/prices_get_updated_throughout_checkout.feature +++ b/features/shop/checkout/prices_get_updated_throughout_checkout.feature @@ -34,7 +34,7 @@ Feature: Prices get updated when exchange rate changes during the whole checkout And I decide to change my address Then the subtotal of "The Pug Mug" item should be "£30.00" - @no-api @todo-ui + @no-api @ui @javascript Scenario: Prices get updated after the select shipping step Given I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" And I have selected "Pigeon Mail" shipping method @@ -42,7 +42,7 @@ Feature: Prices get updated when exchange rate changes during the whole checkout And I complete the shipping step Then the subtotal of "The Pug Mug" item should be "£20.00" - @no-api @todo-ui + @no-api @ui @javascript Scenario: Prices get updated on re-selecting shipping step Given I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" And I have selected "Pigeon Mail" shipping method diff --git a/features/shop/checkout/shipping_order/preventing_not_available_shipping_method_selection.feature b/features/shop/checkout/shipping_order/preventing_not_available_shipping_method_selection.feature index b3a62c99dd..101d731dd7 100644 --- a/features/shop/checkout/shipping_order/preventing_not_available_shipping_method_selection.feature +++ b/features/shop/checkout/shipping_order/preventing_not_available_shipping_method_selection.feature @@ -9,7 +9,7 @@ Feature: Preventing not available shipping method selection And the store has a product "Targaryen T-Shirt" priced at "$19.99" And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select disabled shipping method Given the store has "Raven Post" shipping method with "$10.00" fee And the store has disabled "Dragon Post" shipping method with "$30.00" fee @@ -19,7 +19,7 @@ Feature: Preventing not available shipping method selection And I complete the addressing step Then I should not be able to select "Dragon Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select shipping method not available for my shipping address Given there is a zone "The Rest of the World" containing all other countries And the store has "Dragon Post" shipping method with "$30.00" fee for the rest of the world @@ -30,7 +30,7 @@ Feature: Preventing not available shipping method selection And I complete the addressing step Then I should not be able to select "Dragon Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select shipping method not available for order channel Given the store has "Raven Post" shipping method with "$10.00" fee not assigned to any channel And the store has "Dragon Post" shipping method with "$30.00" fee @@ -40,7 +40,7 @@ Feature: Preventing not available shipping method selection And I complete the addressing step Then I should not be able to select "Raven Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Being alerted about no shipping method available Given there is a zone "The Rest of the World" containing all other countries And the store has "Dragon Post" shipping method with "$30.00" fee for the rest of the world @@ -53,7 +53,7 @@ Feature: Preventing not available shipping method selection And I should not be able to select "Dragon Post" shipping method And I should be informed that my order cannot be shipped to this address - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select an archival shipping method Given the store has "Raven Post" shipping method with "$10.00" fee And the store has an archival "Dragon Post" shipping method with "$30.00" fee @@ -63,7 +63,7 @@ Feature: Preventing not available shipping method selection And I complete the addressing step Then I should not be able to select "Dragon Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select shipping method not available for shipping category of products in cart Given the store has "Over-sized" shipping category And product "Targaryen T-Shirt" belongs to "Over-sized" shipping category @@ -76,7 +76,7 @@ Feature: Preventing not available shipping method selection And I complete the addressing step Then I should not be able to select "Dragon Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Not being able to select shipping method not available due to shipping rules Given the store has "Raven Post" shipping method with "$10.00" fee And the store has "Dragon Post" shipping method with "$30.00" fee diff --git a/features/shop/checkout/shipping_order/preventing_placing_order_with_disabled_shipping_method.feature b/features/shop/checkout/shipping_order/preventing_placing_order_with_disabled_shipping_method.feature index 034caddc49..a41000e86a 100644 --- a/features/shop/checkout/shipping_order/preventing_placing_order_with_disabled_shipping_method.feature +++ b/features/shop/checkout/shipping_order/preventing_placing_order_with_disabled_shipping_method.feature @@ -11,7 +11,7 @@ Feature: Preventing placing an order with a disabled shipping method And the store allows paying "Offline" And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Being prevented from placing an order with a shipping method that's disabled after completing the shipping method choice step Given I added product "Ubi T-Shirt" to the cart And I have proceeded through checkout process with "Raven Post" shipping method @@ -19,7 +19,7 @@ Feature: Preventing placing an order with a disabled shipping method When I try to confirm my order Then I should not be able to confirm order because the "Raven Post" shipping method is not available - @api @todo-ui + @api @ui @javascript Scenario: Being prevented from placing an order with a shipping method that's has been disabled for the customer's country after completing the shipping method choice step Given I added product "Ubi T-Shirt" to the cart And I have proceeded through checkout process with "Raven Post" shipping method diff --git a/features/shop/checkout/shipping_order/preventing_shipping_step_completion_without_a_selected_method.feature b/features/shop/checkout/shipping_order/preventing_shipping_step_completion_without_a_selected_method.feature index 84919f4c41..650a72b59b 100644 --- a/features/shop/checkout/shipping_order/preventing_shipping_step_completion_without_a_selected_method.feature +++ b/features/shop/checkout/shipping_order/preventing_shipping_step_completion_without_a_selected_method.feature @@ -7,17 +7,16 @@ Feature: Preventing shipping step completion without a selected method Background: Given I am a logged in customer - @todo @ui @todo + @todo-api @ui @javascript Scenario: Preventing shipping step completion if there are no available shipping methods 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 I have product "PHP T-Shirt" in the cart When I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" - And I do not select any shipping method - Then I should not be able to complete the shipping step - And there should be information about no shipping methods available for my shipping address + Then I should be informed that my order cannot be shipped to this address + And I should not be able to proceed checkout shipping step - @todo @ui @todo + @todo-api @ui @javascript Scenario: Preventing shipping step completion if there are no available shipping methods for selected country Given the store operates on a channel named "Web" And the store has a product "PHP T-Shirt" priced at "$19.99" @@ -28,10 +27,10 @@ Feature: Preventing shipping step completion without a selected method And the store has "DHL" shipping method with "$20.00" fee within the "EU" zone And I have product "PHP T-Shirt" in the cart When I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" - Then I should not be able to complete the shipping step - And there should be information about no shipping methods available for my shipping address + Then I should be informed that my order cannot be shipped to this address + And I should not be able to proceed checkout shipping step - @todo @ui @todo + @todo-api @no-ui Scenario: Preventing shipping step completion if there are no available shipping methods for selected country Given the store operates on a channel named "Web" And the store has a product "PHP T-Shirt" priced at "$19.99" diff --git a/features/shop/checkout/shipping_order/returning_from_shipping_step_to_addressing_step.feature b/features/shop/checkout/shipping_order/returning_from_shipping_step_to_addressing_step.feature index 3000dc00d7..1d5661a976 100644 --- a/features/shop/checkout/shipping_order/returning_from_shipping_step_to_addressing_step.feature +++ b/features/shop/checkout/shipping_order/returning_from_shipping_step_to_addressing_step.feature @@ -10,7 +10,7 @@ Feature: Returning from shipping step to addressing step And the store ships everywhere for Free And I am a logged in customer - @no-api @todo-ui + @no-api @ui @javascript Scenario: Going back to addressing step with button Given I have product "Apollo 11 T-Shirt" in the cart And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" @@ -18,7 +18,7 @@ Feature: Returning from shipping step to addressing step Then I should be redirected to the addressing step And I should be able to go to the shipping step again - @no-api @todo-ui + @no-api @ui @javascript Scenario: Going back to the addressing step with steps panel Given I have product "Apollo 11 T-Shirt" in the cart And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" diff --git a/features/shop/checkout/shipping_order/seeing_default_shipping_method_selected_based_on_shipping_address.feature b/features/shop/checkout/shipping_order/seeing_default_shipping_method_selected_based_on_shipping_address.feature index a92b9f7cfa..ba932a7203 100644 --- a/features/shop/checkout/shipping_order/seeing_default_shipping_method_selected_based_on_shipping_address.feature +++ b/features/shop/checkout/shipping_order/seeing_default_shipping_method_selected_based_on_shipping_address.feature @@ -17,7 +17,7 @@ Feature: Seeing default shipping method selected based on shipping address And the store has "FedEx" shipping method with "$20.00" fee within the "UK" zone And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing default shipping method selected based on country from billing address Given I have product "Star Trek Ship" in the cart And I am at the checkout addressing step @@ -27,7 +27,7 @@ Feature: Seeing default shipping method selected based on shipping address And I should see selected "DHL" shipping method And I should not see "FedEx" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing default shipping method selected based on country from billing address after readdressing Given I have product "Star Trek Ship" in the cart And I am at the checkout addressing step diff --git a/features/shop/checkout/shipping_order/seeing_shipping_fee.feature b/features/shop/checkout/shipping_order/seeing_shipping_fee.feature index ce32e63b2a..21ab78b0b0 100644 --- a/features/shop/checkout/shipping_order/seeing_shipping_fee.feature +++ b/features/shop/checkout/shipping_order/seeing_shipping_fee.feature @@ -11,7 +11,7 @@ Feature: Seeing detailed shipping fee on selecting shipping method page And the store allows paying Offline And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing the shipping fee per shipment on selecting shipping method Given the store has "UPS" shipping method with "$20.00" fee And I have product "The Sorting Hat" in the cart @@ -19,7 +19,7 @@ Feature: Seeing detailed shipping fee on selecting shipping method page Then I should be on the checkout shipping step And I should see shipping method "UPS" with fee "$20.00" - @api @todo-ui + @api @ui @javascript Scenario: Seeing the shipping fee per unit on selecting shipping method Given the store has "UPS" shipping method with "$5.00" fee per unit And I have product "The Sorting Hat" in the cart diff --git a/features/shop/checkout/shipping_order/seeing_shipping_fee_on_multiple_channels.feature b/features/shop/checkout/shipping_order/seeing_shipping_fee_on_multiple_channels.feature index f474bc56d6..7adfd76859 100644 --- a/features/shop/checkout/shipping_order/seeing_shipping_fee_on_multiple_channels.feature +++ b/features/shop/checkout/shipping_order/seeing_shipping_fee_on_multiple_channels.feature @@ -16,7 +16,7 @@ Feature: Seeing detailed shipping fee on multiple channels with different base c And the store has a product "PHP T-Shirt" priced at "$12.54" available in channel "Web-US" and channel "Web-GB" And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing the shipping fee per shipment on selecting method in a channel's base currency Given I changed my current channel to "Web-US" And I have product "PHP T-Shirt" in the cart @@ -25,7 +25,7 @@ Feature: Seeing detailed shipping fee on multiple channels with different base c And I should see shipping method "UPS" with fee "$15.00" And I should see shipping method "FedEx" with fee "$10.00" - @api @todo-ui + @api @ui @javascript Scenario: Seeing the shipping fee on selecting shipping method on a different channel in its base currency Given I changed my current channel to "Web-GB" And I have added 2 products "PHP T-Shirt" in the cart diff --git a/features/shop/checkout/shipping_order/seeing_shipping_method_when_all_units_match_to_shipping_category.feature b/features/shop/checkout/shipping_order/seeing_shipping_method_when_all_units_match_to_shipping_category.feature index f53735bbaf..8df50bebf2 100644 --- a/features/shop/checkout/shipping_order/seeing_shipping_method_when_all_units_match_to_shipping_category.feature +++ b/features/shop/checkout/shipping_order/seeing_shipping_method_when_all_units_match_to_shipping_category.feature @@ -23,7 +23,7 @@ Feature: Seeing shipping methods which category is same as category of all my un And this shipping method requires that all units match to "Over-sized" shipping category And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing only shipping method which category is same as categories of all my units Given I have product "Rocket T-Shirt" in the cart And I have product "Picasso T-Shirt" in the cart @@ -34,7 +34,7 @@ Feature: Seeing shipping methods which category is same as category of all my un And I should see "Raven Post" shipping method And I should not see "Invisible Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping method which category is same as category of my unit Given I have product "Star Trek Ship" in the cart When I am at the checkout addressing step @@ -44,7 +44,7 @@ Feature: Seeing shipping methods which category is same as category of all my un And I should see "Invisible Post" shipping method And I should not see "Raven Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing no shipping methods if my units matches to different shipping categories And I have product "Rocket T-Shirt" in the cart And I have product "Star Trek Ship" in the cart @@ -53,7 +53,7 @@ Feature: Seeing shipping methods which category is same as category of all my un And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui + @api @ui @mink:chromedriver Scenario: Seeing no shipping methods if not all variants of my units has same shipping category Given the "T-Shirt banana" product's "S" size belongs to "Standard" shipping category And the "T-Shirt banana" product's "M" size belongs to "Over-sized" shipping category @@ -64,7 +64,7 @@ Feature: Seeing shipping methods which category is same as category of all my un And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui + @api @ui @mink:chromedriver Scenario: Seeing shipping methods if all variants of my units has same shipping category Given the "T-Shirt banana" product's "M" size belongs to "Standard" shipping category And the "T-Shirt banana" product's "S" size belongs to "Standard" shipping category diff --git a/features/shop/checkout/shipping_order/seeing_shipping_method_when_at_least_one_unit_match_to_shipping_method.feature b/features/shop/checkout/shipping_order/seeing_shipping_method_when_at_least_one_unit_match_to_shipping_method.feature index ce60d66b34..394fc37027 100644 --- a/features/shop/checkout/shipping_order/seeing_shipping_method_when_at_least_one_unit_match_to_shipping_method.feature +++ b/features/shop/checkout/shipping_order/seeing_shipping_method_when_at_least_one_unit_match_to_shipping_method.feature @@ -21,7 +21,7 @@ Feature: Seeing shipping methods compatible with categories of units in my cart And this shipping method requires at least one unit matches to "Over-sized" shipping category And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods which match to my units categories Given I have product "Star Trek Ship" in the cart And I have product "Picasso T-Shirt" in the cart @@ -32,7 +32,7 @@ Feature: Seeing shipping methods compatible with categories of units in my cart And I should see "Raven Post" shipping method And I should see "Invisible Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Not seeing shipping method which not match to my units category Given I have product "Star Trek Ship" in the cart When I am at the checkout addressing step @@ -42,7 +42,7 @@ Feature: Seeing shipping methods compatible with categories of units in my cart And I should see "Invisible Post" shipping method And I should not see "Raven Post" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing no shipping methods if any of them match to my units categories Given the store has a product "Rocket T-Shirt" priced at "$20.00" And I have product "Rocket T-Shirt" in the cart @@ -51,7 +51,7 @@ Feature: Seeing shipping methods compatible with categories of units in my cart And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui + @api @ui @mink:chromedriver Scenario: Seeing no shipping methods if any of my unit has variant with shipping category matching to the shipping category of shipping method Given I have product "T-Shirt banana" with product option "Size" S in the cart And I have product "T-Shirt banana" with product option "Size" M in the cart @@ -60,7 +60,7 @@ Feature: Seeing shipping methods compatible with categories of units in my cart And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui + @api @ui @mink:chromedriver Scenario: Seeing shipping methods if some of my unit has variant with shipping category matching to the shipping category of shipping method Given the "T-Shirt banana" product's "M" size belongs to "Standard" shipping category And the "T-Shirt banana" product's "S" size belongs to "Over-sized" shipping category diff --git a/features/shop/checkout/shipping_order/seeing_shipping_method_when_no_units_match_to_shipping_category.feature b/features/shop/checkout/shipping_order/seeing_shipping_method_when_no_units_match_to_shipping_category.feature index 1ee0571f30..c2ffef48c6 100644 --- a/features/shop/checkout/shipping_order/seeing_shipping_method_when_no_units_match_to_shipping_category.feature +++ b/features/shop/checkout/shipping_order/seeing_shipping_method_when_no_units_match_to_shipping_category.feature @@ -18,8 +18,8 @@ Feature: Seeing shipping methods which category is not same as any category of a And this shipping method requires that no units match to "Over-sized" shipping category And I am a logged in customer - @api @todo-ui - Scenario: Seeing shipping method which category is not same as category of all my units + @api @ui @javascript + Scenario: Seeing shipping methods when all of my products fit the shipping category Given I have product "Picasso T-Shirt" in the cart When I am at the checkout addressing step And I specify the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" @@ -27,16 +27,16 @@ Feature: Seeing shipping methods which category is not same as any category of a Then I should be on the checkout shipping step And I should see "Invisible Post" shipping method - @api @todo-ui - Scenario: Seeing no shipping methods if its category is same as category of all my units + @api @ui @javascript + Scenario: Seeing no shipping methods when all of my products are excluded from the shipping category Given I have product "Star Trek Ship" in the cart When I am at the checkout addressing step And I specify the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui - Scenario: Seeing no shipping methods if its category is same as one category from my units categories + @api @ui @javascript + Scenario: Seeing no shipping methods when any of my products is excluded from the shipping category Given I have product "Picasso T-Shirt" in the cart And I have product "Star Trek Ship" in the cart When I am at the checkout addressing step @@ -44,9 +44,9 @@ Feature: Seeing shipping methods which category is not same as any category of a And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui - Scenario: Seeing no shipping methods if any of my unit has product variants which shipping category matching to the shipping category from shipping method - And the "T-Shirt banana" product's "S" size belongs to "Over-sized" shipping category + @api @ui @mink:chromedriver + Scenario: Seeing no shipping methods when any of my variants is excluded from the shipping category + Given the "T-Shirt banana" product's "S" size belongs to "Over-sized" shipping category And I have product "T-Shirt banana" with product option "Size" S in the cart And I have product "T-Shirt banana" with product option "Size" M in the cart When I am at the checkout addressing step @@ -54,9 +54,9 @@ Feature: Seeing shipping methods which category is not same as any category of a And I complete the addressing step Then there should be information about no available shipping methods - @api @todo-ui - Scenario: Seeing shipping methods if none of my unit has variant with shipping method matching to the shipping category from shipping method - And I have product "T-Shirt banana" with product option "Size" S in the cart + @api @ui @mink:chromedriver + Scenario: Seeing shipping methods when all of my variants fit the shipping category + Given I have product "T-Shirt banana" with product option "Size" S in the cart And I have product "T-Shirt banana" with product option "Size" M in the cart When I am at the checkout addressing step And I specify the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" diff --git a/features/shop/checkout/shipping_order/selecting_order_shipping_method.feature b/features/shop/checkout/shipping_order/selecting_order_shipping_method.feature index 72c7436a05..4b389ac259 100644 --- a/features/shop/checkout/shipping_order/selecting_order_shipping_method.feature +++ b/features/shop/checkout/shipping_order/selecting_order_shipping_method.feature @@ -11,7 +11,7 @@ Feature: Selecting order shipping method And the store has "Dragon Post" shipping method with "$30.00" fee And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Selecting one of available shipping method Given I have product "Targaryen T-Shirt" in the cart And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow" diff --git a/features/shop/checkout/shipping_order/shipping_method_integrity_validation.feature b/features/shop/checkout/shipping_order/shipping_method_integrity_validation.feature index f8d1583b11..eda726aa3b 100644 --- a/features/shop/checkout/shipping_order/shipping_method_integrity_validation.feature +++ b/features/shop/checkout/shipping_order/shipping_method_integrity_validation.feature @@ -18,7 +18,7 @@ Feature: Order shipping method integrity And the store has a product "T-Shirt Breaking Bad" priced at "$12.54" And this product belongs to "Small stuff" shipping category - @api @todo-ui + @api @ui @javascript 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 billing address diff --git a/features/shop/checkout/shipping_order/sorting_shipping_method_selection.feature b/features/shop/checkout/shipping_order/sorting_shipping_method_selection.feature index 600c93a07f..6061dd3c35 100644 --- a/features/shop/checkout/shipping_order/sorting_shipping_method_selection.feature +++ b/features/shop/checkout/shipping_order/sorting_shipping_method_selection.feature @@ -12,7 +12,7 @@ Feature: Sorting shipping method selection And the store also allows shipping with "Pug Blimp" at position 1 And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods sorted Given I have product "Targaryen T-Shirt" in the cart When I am at the checkout addressing step diff --git a/features/shop/checkout/skipping_shipping_and_payment_step_when_order_does_not_require_any_shipping_and_its_total_is_zero.feature b/features/shop/checkout/skipping_shipping_and_payment_step_when_order_does_not_require_any_shipping_and_its_total_is_zero.feature index 6b0fc2c1d2..bd5b248fc5 100644 --- a/features/shop/checkout/skipping_shipping_and_payment_step_when_order_does_not_require_any_shipping_and_its_total_is_zero.feature +++ b/features/shop/checkout/skipping_shipping_and_payment_step_when_order_does_not_require_any_shipping_and_its_total_is_zero.feature @@ -13,7 +13,7 @@ Feature: Skipping shipping and payment step when order does not require any ship And the promotion gives "$40.00" discount to every order with quantity at least 1 And I am a logged in customer - @no-api @todo-ui + @no-api @ui @javascript Scenario: Seeing order summary page after addressing if none of order items require shipping and order total is zero Given I have "Guards! Guards! - ebook" variant of product "Guards! Guards!" in the cart And I am at the checkout addressing step diff --git a/features/shop/checkout/skipping_shipping_step_when_only_one_shipping_method_is_available.feature b/features/shop/checkout/skipping_shipping_step_when_only_one_shipping_method_is_available.feature index a78d1c7f96..32f88e67a2 100644 --- a/features/shop/checkout/skipping_shipping_step_when_only_one_shipping_method_is_available.feature +++ b/features/shop/checkout/skipping_shipping_step_when_only_one_shipping_method_is_available.feature @@ -11,7 +11,7 @@ Feature: Skipping shipping step when only one shipping method is available And the store allows paying with "Paypal Express Checkout" And I am a logged in customer - @api @todo-ui + @api @todo-ui @javascript Scenario: Seeing checkout payment page after addressing if only one shipping method is available Given the store has "DHL" shipping method with "$5.00" fee And I have product "Guards! Guards!" in the cart @@ -23,7 +23,7 @@ Feature: Skipping shipping step when only one shipping method is available Then I should be on the checkout complete step And my order's shipping method should be "DHL" - @api @todo-ui + @api @todo-ui @javascript Scenario: Seeing checkout payment page after addressing if only one shipping method is available for current channel Given the store has "DHL" shipping method with "$5.00" fee And the store has "FedEx" shipping method with "$15.00" fee not assigned to any channel @@ -36,7 +36,7 @@ Feature: Skipping shipping step when only one shipping method is available Then I should be on the checkout complete step And my order's shipping method should be "DHL" - @api @todo-ui + @api @todo-ui @javascript Scenario: Seeing checkout payment page after addressing if only one shipping method is enabled for current channel Given the store has "DHL" shipping method with "$5.00" fee And the store has disabled "FedEx" shipping method with "$15.00" fee diff --git a/features/shop/checkout/skipping_shipping_step_when_order_does_not_require_any_shipping.feature b/features/shop/checkout/skipping_shipping_step_when_order_does_not_require_any_shipping.feature index 105cbd3028..95dbb4a95c 100644 --- a/features/shop/checkout/skipping_shipping_step_when_order_does_not_require_any_shipping.feature +++ b/features/shop/checkout/skipping_shipping_step_when_order_does_not_require_any_shipping.feature @@ -12,7 +12,7 @@ Feature: Skipping shipping step when order does not require any shipping And the store has "SHL" shipping method with "$5.00" fee And I am a logged in customer - @no-api @todo-ui + @no-api @ui @javascript Scenario: Seeing checkout payment page after addressing if none of order items require shipping Given I have "Guards! Guards! - ebook" variant of product "Guards! Guards!" in the cart And I am at the checkout addressing step @@ -20,7 +20,7 @@ Feature: Skipping shipping step when order does not require any shipping And I complete the addressing step Then I should be on the checkout payment step - @no-api @todo-ui + @no-api @ui @javascript Scenario: Seeing checkout shipping page after addressing if at least one of order items require shipping Given I have "Guards! Guards! - ebook" variant of product "Guards! Guards!" in the cart And I have "Guards! Guards! - book" variant of product "Guards! Guards!" in the cart diff --git a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_on_order.feature b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_on_order.feature index 6232231dbc..79c53a8b06 100644 --- a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_on_order.feature +++ b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_on_order.feature @@ -12,7 +12,7 @@ Feature: Apply correct shipping fee on order And the store has "UPS" shipping method with "$5.00" fee per unit for "United States" channel And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Adding proper shipping fee Given I have product "PHP T-Shirt" in the cart And I addressed the cart @@ -21,7 +21,7 @@ Feature: Apply correct shipping fee on order Then my cart total should be "$110.00" And my cart shipping total should be "$10.00" - @api @todo-ui + @api @ui @javascript Scenario: Changing shipping fee after shipping method change Given I have product "PHP T-Shirt" in the cart And I addressed the cart @@ -32,7 +32,7 @@ Feature: Apply correct shipping fee on order Then my cart total should be "$130.00" And my cart shipping total should be "$30.00" - @api @todo-ui + @api @ui @javascript Scenario: Changing per unit shipping fee after decreasing quantity of item Given I have 2 products "PHP T-Shirt" in the cart And I addressed the cart diff --git a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_product_taxes_on_order.feature b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_product_taxes_on_order.feature index 0540b2dfbf..5f1fbfc6e7 100644 --- a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_product_taxes_on_order.feature +++ b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_product_taxes_on_order.feature @@ -21,7 +21,7 @@ Feature: Apply correct shipping fee with product taxes on order And the store allows paying Offline And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Proper shipping fee, tax and product tax Given I have product "PHP T-Shirt" in the cart And I addressed the cart @@ -31,7 +31,7 @@ Feature: Apply correct shipping fee with product taxes on order And my cart taxes should be "$25.30" And my cart shipping total should be "$12.30" - @api @todo-ui + @api @ui @javascript Scenario: Proper shipping fee, tax and products' taxes after addressing Given I have 3 products "PHP T-Shirt" in the cart When I proceed with selecting "Germany" as billing country diff --git a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_taxes_on_order.feature b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_taxes_on_order.feature index 21824d3f54..ac28a497b1 100644 --- a/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_taxes_on_order.feature +++ b/features/shop/shipping/applying_shipping_fee/applying_correct_shipping_fee_with_taxes_on_order.feature @@ -20,7 +20,7 @@ Feature: Apply correct shipping fee with taxes on order And the store allows paying Offline And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Proper shipping fee and tax Given I have product "PHP T-Shirt" in the cart And I addressed the cart @@ -30,7 +30,7 @@ Feature: Apply correct shipping fee with taxes on order And my cart taxes should be "$2.30" And my cart shipping total should be "$12.30" - @api @todo-ui + @api @ui @javascript Scenario: Proper shipping fee and tax after addressing Given I have product "PHP T-Shirt" in the cart When I proceed with selecting "Germany" as billing country diff --git a/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_items_total.feature b/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_items_total.feature index 053b87917e..2e52bf9806 100644 --- a/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_items_total.feature +++ b/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_items_total.feature @@ -14,12 +14,12 @@ Feature: Seeing estimated shipping costs based on items total And this shipping method is only available for orders under or equal to "$29.99" And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing valid estimated shipping cost for the cart with a value over minimum price configured on the shipping method When I add product "Expensive Jacket" to the cart Then my cart estimated shipping cost should be "$1.00" - @api @todo-ui + @api @ui @javascript Scenario: Seeing valid estimated shipping cost for the cart with a value under maximum price configured on the shipping method When I add product "Cheap Jacket" to the cart Then my cart estimated shipping cost should be "$10.00" diff --git a/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_total_weight.feature b/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_total_weight.feature index 01d04bec80..428b65973c 100644 --- a/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_total_weight.feature +++ b/features/shop/shipping/applying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_total_weight.feature @@ -16,12 +16,12 @@ Feature: Seeing estimated shipping costs based on total weight And this shipping method is only available for orders with a total weight less or equal to 1.0 And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing valid estimated shipping cost for the cart with a total weight over minimum total weight configured on the shipping method When I add product "Jacket for the Lochness Monster" to the cart Then my cart estimated shipping cost should be "$200.00" - @api @todo-ui + @api @ui @javascript Scenario: Seeing valid estimated shipping cost for the cart with a total weight under maximum total weight configured on the shipping method When I add product "T-Shirt for Tinkerbell" to the cart Then my cart estimated shipping cost should be "$2.00" diff --git a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total.feature b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total.feature index 74c507cbb1..bb3b494857 100644 --- a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total.feature +++ b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total.feature @@ -15,7 +15,7 @@ Feature: Viewing available shipping methods based on items total And the store has "DHL" shipping method with "$20.00" fee And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle expensive goods Given I have product "Expensive Jacket" in the cart When I specified the billing address @@ -24,7 +24,7 @@ Feature: Viewing available shipping methods based on items total And I should see "Above $50" shipping method And I should not see "Below $29.99" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle cheap goods Given I have product "Cheap Jacket" in the cart When I specified the billing address @@ -33,7 +33,7 @@ Feature: Viewing available shipping methods based on items total And I should see "Below $29.99" shipping method And I should not see "Above $50" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle all goods Given I have 2 products "Cheap Jacket" in the cart When I specified the billing address diff --git a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total_with_taxes_and_promotions.feature b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total_with_taxes_and_promotions.feature index 9aec6c4497..bfc802d0e8 100644 --- a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total_with_taxes_and_promotions.feature +++ b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_items_total_with_taxes_and_promotions.feature @@ -25,7 +25,7 @@ Feature: Viewing available shipping methods based on items total And it gives "$5.00" off on a "Expensive Jacket" product And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle expensive goods Given I have product "Expensive Jacket" in the cart When I specified the billing address @@ -34,7 +34,7 @@ Feature: Viewing available shipping methods based on items total And I should see "Above $50" shipping method And I should not see "Below $29.99" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle cheap goods Given I have product "Cheap Jacket" in the cart When I specified the billing address @@ -43,7 +43,7 @@ Feature: Viewing available shipping methods based on items total And I should see "Below $29.99" shipping method And I should not see "Above $50" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle all goods Given I have 2 products "Cheap Jacket" in the cart When I specified the billing address diff --git a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_total_weight.feature b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_total_weight.feature index b640a3c666..855852ed9d 100644 --- a/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_total_weight.feature +++ b/features/shop/shipping/applying_shipping_method_rules/viewing_available_shipping_methods_based_on_total_weight.feature @@ -17,7 +17,7 @@ Feature: Viewing available shipping methods based on total weight And this shipping method is only available for orders with a total weight less or equal to 1.0 And I am a logged in customer - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle heavy goods Given I have product "Jacket for the Lochness Monster" in the cart When I specified the billing address @@ -26,7 +26,7 @@ Feature: Viewing available shipping methods based on total weight And I should see "Heavy Duty Courier" shipping method And I should not see "Fairytale Delivery Service" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle light goods Given I have product "T-Shirt for Tinkerbell" in the cart When I specified the billing address @@ -35,7 +35,7 @@ Feature: Viewing available shipping methods based on total weight And I should see "Fairytale Delivery Service" shipping method And I should not see "Heavy Duty Courier" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that handle all goods Given I have product "T-Shirt for Tinkerbell" in the cart And I add 11 of them to my cart diff --git a/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_shop_user.feature b/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_shop_user.feature index ee23ee92cf..d4aeb01a3a 100644 --- a/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_shop_user.feature +++ b/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_shop_user.feature @@ -16,7 +16,7 @@ Feature: Viewing available shipping methods based on channel as a Shop User And the store has a product "T-Shirt" priced at "$20.00" available in channel "United Kingdom" and channel "United States" And I am a logged in customer - @todo @api @ui + @api @ui @javascript Scenario: Seeing shipping methods that are available in channel as an logged in customer Given I changed my current channel to "United States" And I have product "T-Shirt" in the cart @@ -25,7 +25,7 @@ Feature: Viewing available shipping methods based on channel as a Shop User And I should see "ultra fast" shipping method And I should not see "uber speedy" shipping method - @todo @api @ui + @api @ui @javascript Scenario: Seeing shipping methods that are available in another channel as an logged in customer Given I changed my current channel to "United Kingdom" And I have product "T-Shirt" in the cart diff --git a/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_visitor.feature b/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_visitor.feature index 2e432fb2da..e1bc7caa75 100644 --- a/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_visitor.feature +++ b/features/shop/shipping/viewing_shipping_methods/viewing_available_shipping_methods_based_on_channel_as_a_visitor.feature @@ -15,7 +15,7 @@ Feature: Viewing available shipping methods based on channel as a Visitor And the store has "uber speedy" shipping method with "$15.00" fee per shipment for "United Kingdom" channel And the store has a product "T-Shirt" priced at "$20.00" available in channel "United Kingdom" and channel "United States" - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that are available in channel Given I changed my current channel to "United States" And I have product "T-Shirt" in the cart @@ -24,7 +24,7 @@ Feature: Viewing available shipping methods based on channel as a Visitor And I should see "ultra fast" shipping method And I should not see "uber speedy" shipping method - @api @todo-ui + @api @ui @javascript Scenario: Seeing shipping methods that are available in another channel Given I changed my current channel to "United Kingdom" And I have product "T-Shirt" in the cart diff --git a/src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php b/src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php index b5a2184b97..d4ff38c81c 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/Checkout/CheckoutShippingContext.php @@ -212,6 +212,9 @@ final readonly class CheckoutShippingContext implements Context try { $this->selectShippingPage->nextStep(); + if ($this->selectShippingPage->isOpen()) { + return; + } } catch (ElementNotFoundException) { return; } diff --git a/src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php b/src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php index 332b42efc2..aaea298177 100644 --- a/src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php +++ b/src/Sylius/Behat/Page/Shop/Checkout/SelectShippingPage.php @@ -13,7 +13,6 @@ declare(strict_types=1); namespace Sylius\Behat\Page\Shop\Checkout; -use Behat\Mink\Element\NodeElement; use Behat\Mink\Exception\ElementNotFoundException; use FriendsOfBehat\PageObjectExtension\Page\SymfonyPage; use Sylius\Behat\Service\DriverHelper; @@ -39,11 +38,11 @@ class SelectShippingPage extends SymfonyPage implements SelectShippingPageInterf public function getShippingMethods(): array { - $inputs = $this->getSession()->getPage()->findAll('css', '[data-test-shipping-method-label]'); + $inputs = $this->getDocument()->findAll('css', '[data-test-shipping-method-select]'); $shippingMethods = []; foreach ($inputs as $input) { - $shippingMethods[] = trim($input->getText()); + $shippingMethods[] = trim($input->getParent()->getText()); } return $shippingMethods; @@ -51,16 +50,10 @@ class SelectShippingPage extends SymfonyPage implements SelectShippingPageInterf public function getSelectedShippingMethodName(): ?string { - $shippingMethods = $this->getSession()->getPage()->findAll('css', '[data-test-shipping-item]'); - - /** @var NodeElement $shippingMethod */ - foreach ($shippingMethods as $shippingMethod) { - if (null !== $shippingMethod->find('css', 'input:checked')) { - return $shippingMethod->find('css', '[data-test-shipping-method-label]')->getText(); - } - } - - return null; + return $this->hasElement('shipping_method_option_selected') + ? $this->getElement('shipping_method_option_selected')->getParent()->getText() + : null + ; } public function hasNoShippingMethodsMessage(): bool @@ -137,14 +130,7 @@ class SelectShippingPage extends SymfonyPage implements SelectShippingPageInterf public function hasShippingMethod(string $shippingMethodName): bool { - $inputs = $this->getSession()->getPage()->findAll('css', '[data-test-shipping-method-label]'); - - $shippingMethods = []; - foreach ($inputs as $input) { - $shippingMethods[] = trim($input->getText()); - } - - return in_array($shippingMethodName, $shippingMethods); + return $this->hasElement('shipping_method_item', ['%shipping_method%' => $shippingMethodName]); } protected function getDefinedElements(): array @@ -156,10 +142,11 @@ class SelectShippingPage extends SymfonyPage implements SelectShippingPageInterf 'order_cannot_be_shipped_message' => '[data-test-order-cannot-be-shipped]', 'purchaser_email' => '[data-test-purchaser-name-or-email]', 'shipment' => '[data-test-shipments]', - 'shipping_method' => '[data-test-shipping-method-select]', + 'shipping_method_item' => '[data-test-shipping-item]:contains("%shipping_method%")', 'shipping_method_fee' => '[data-test-shipping-item]:contains("%shipping_method%") [data-test-shipping-method-fee]', 'shipping_method_select' => '[data-test-shipping-item]:contains("%shipping_method%") [data-test-shipping-method-checkbox]', 'shipping_method_option' => '[data-test-shipping-item]:contains("%shipping_method%") [data-test-shipping-method-select]', + 'shipping_method_option_selected' => '[data-test-shipping-method-select][checked="checked"]', 'warning_no_shipping_methods' => '[data-test-order-cannot-be-shipped]', ]); }