From fc598757a3e2a49dec17368f4b9366acc1b36dff Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Tue, 14 Nov 2023 19:45:27 +0100 Subject: [PATCH] [Behat] Enable the rest of the admin order billing scenarios --- .../modifying_billing_address_on_order_with_coupon.feature | 2 +- .../modifying_billing_address_on_order_with_promotion.feature | 2 +- .../modifying_billing_address_on_order_with_taxes.feature | 2 +- .../modifying_billing_address_validation.feature | 2 +- src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php | 2 ++ 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_coupon.feature b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_coupon.feature index 806ae175904b..26763cd0794a 100644 --- a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_coupon.feature +++ b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_coupon.feature @@ -27,6 +27,6 @@ Feature: Modifying a customer's billing address on an order with an applied coup And I specify their new billing address as "Los Angeles", "Seaside Fwy", "90802", "United States" for "Lucifer Morningstar" And I save my changes Then I should be notified that it has been successfully edited - And the order should be billed to "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" + And this order should have "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" as its new billing address And the order's total should still be "$350.00" And the order's promotion total should still be "-$50.00" diff --git a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_promotion.feature b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_promotion.feature index caa1f7103495..48cfc378376b 100644 --- a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_promotion.feature +++ b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_promotion.feature @@ -27,6 +27,6 @@ Feature: Modifying a customer's billing address on an order with an applied prom And I specify their new billing address as "Los Angeles", "Seaside Fwy", "90802", "United States" for "Lucifer Morningstar" And I save my changes Then I should be notified that it has been successfully edited - And the order should be billed to "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" + And this order should have "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" as its new billing address And the order's total should still be "$350.00" And the order's promotion total should still be "-$50.00" diff --git a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_taxes.feature b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_taxes.feature index b31c78c81d01..b4b9eed25434 100644 --- a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_taxes.feature +++ b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_on_order_with_taxes.feature @@ -25,6 +25,6 @@ Feature: Modifying a customer's billing address on an order with taxes And I specify their new billing address as "Los Angeles", "Seaside Fwy", "90802", "United States" for "Lucifer Morningstar" And I save my changes Then I should be notified that it has been successfully edited - And the order should be billed to "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" + And this order should have "Lucifer Morningstar", "Seaside Fwy", "90802", "Los Angeles", "United States" as its new billing address And the order's total should still be "$480.00" And the order's tax total should still be "$80.00" diff --git a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_validation.feature b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_validation.feature index 26bde91fbd5c..611ba2295bf8 100644 --- a/features/order/managing_orders/modifying_billing_address/modifying_billing_address_validation.feature +++ b/features/order/managing_orders/modifying_billing_address/modifying_billing_address_validation.feature @@ -16,7 +16,7 @@ Feature: Modifying a customer's billing address validation And the customer chose "Free" shipping method with "Cash on Delivery" payment And I am logged in as an administrator - @api @ui + @ui @no-api Scenario: Address an order without name, city and street When I view the summary of the order "#00000001" And I want to modify a customer's billing address of this order diff --git a/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php b/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php index ba2073cc9da6..a4ded44dcfe8 100644 --- a/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php +++ b/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php @@ -298,6 +298,8 @@ public function theOrdersTotalShouldBe(int $total): void */ public function theOrdersPromotionTotalShouldBe(int $promotionTotal): void { + $this->client->show(Resources::ORDERS, $this->sharedStorage->get('order')->getTokenValue()); + Assert::same( $this->responseChecker->getValue($this->client->getLastResponse(), 'orderPromotionTotal'), $promotionTotal,