From 3c2771b1fd09ae52b237b8d6ef85aa36c2f66619 Mon Sep 17 00:00:00 2001 From: Arminek Date: Thu, 7 Jul 2016 13:56:54 +0200 Subject: [PATCH] [Checkout][Behat] Add placing an order as guest scenario --- ...g_offline_during_checkout_as_guest.feature | 21 +++++++++++++++++++ .../Behat/Context/Ui/CheckoutContext.php | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 features/checkout/paying_for_order/paying_offline_during_checkout_as_guest.feature diff --git a/features/checkout/paying_for_order/paying_offline_during_checkout_as_guest.feature b/features/checkout/paying_for_order/paying_offline_during_checkout_as_guest.feature new file mode 100644 index 0000000000..16d9d8cab1 --- /dev/null +++ b/features/checkout/paying_for_order/paying_offline_during_checkout_as_guest.feature @@ -0,0 +1,21 @@ +@paying_for_order +Feature: Paying offline during checkout as guest + In order to pay with cash or by external means + As a Guest + I want to be able to complete checkout process without paying + + Background: + Given the store operates on a single channel in "France" + 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 + + @ui + Scenario: Successfully placing an order + Given I have product "PHP T-Shirt" in the cart + When I complete addressing step with email "john@example.com" and "France" as shipping country + And I select "Free" shipping method + And I complete the shipping step + And I choose "Offline" payment method + And I confirm my order + Then I should see the thank you page diff --git a/src/Sylius/Behat/Context/Ui/CheckoutContext.php b/src/Sylius/Behat/Context/Ui/CheckoutContext.php index dc00cd31c3..805243023d 100644 --- a/src/Sylius/Behat/Context/Ui/CheckoutContext.php +++ b/src/Sylius/Behat/Context/Ui/CheckoutContext.php @@ -856,8 +856,9 @@ final class CheckoutContext implements Context */ public function iCompleteAddressingStepWithEmail($email, AddressInterface $address) { - $this->iSpecifiedTheShippingAddress($address); + $this->addressingPage->open(); $this->iSpecifyTheEmail($email); + $this->iSpecifyTheShippingAddressAs($address); $this->iCompleteTheAddressingStep(); }