|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontShippingMethodIsNotApplicableInReviewAndPaymentStepTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Not applicable Shipping Method In Review and Payment Step"/> |
| 13 | + <stories value="Checkout Shipping Method Recalculation after Coupon Code Added"/> |
| 14 | + <description value="User should not be able to place order when free shipping declined after applying coupon code"/> |
| 15 | + <features value="Checkout"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MC-22625"/> |
| 18 | + <useCaseId value="MC-21926"/> |
| 19 | + <group value="checkout"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!-- Enable Free Shipping Method and set Minimum Order Amount to 100--> |
| 24 | + <magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.enabled}}" stepKey="enableFreeShippingMethod" /> |
| 25 | + <magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.hundred}}" stepKey="setFreeShippingMethodMinimumOrderAmountToBe100" /> |
| 26 | + |
| 27 | + <!--Set Fedex configs data--> |
| 28 | + <magentoCLI command="config:set {{AdminFedexEnableForCheckoutConfigData.path}} {{AdminFedexEnableForCheckoutConfigData.value}}" stepKey="enableCheckout"/> |
| 29 | + <magentoCLI command="config:set {{AdminFedexEnableSandboxModeConfigData.path}} {{AdminFedexEnableSandboxModeConfigData.value}}" stepKey="enableSandbox"/> |
| 30 | + <magentoCLI command="config:set {{AdminFedexEnableDebugConfigData.path}} {{AdminFedexEnableDebugConfigData.value}}" stepKey="enableDebug"/> |
| 31 | + <magentoCLI command="config:set {{AdminFedexEnableShowMethodConfigData.path}} {{AdminFedexEnableShowMethodConfigData.value}}" stepKey="enableShowMethod"/> |
| 32 | + |
| 33 | + <!--Set StoreInformation configs data--> |
| 34 | + <actionGroup ref="AdminSetStoreInformationConfigurationActionGroup" stepKey="setStoreInformationConfigData"> |
| 35 | + <argument name="telephone" value="{{DE_Address_Berlin_Not_Default_Address.telephone}}"/> |
| 36 | + <argument name="country" value="{{DE_Address_Berlin_Not_Default_Address.country_id}}"/> |
| 37 | + <argument name="state" value="{{DE_Address_Berlin_Not_Default_Address.state}}"/> |
| 38 | + <argument name="city" value="{{DE_Address_Berlin_Not_Default_Address.city}}"/> |
| 39 | + <argument name="postcode" value="{{DE_Address_Berlin_Not_Default_Address.postcode}}"/> |
| 40 | + <argument name="street" value="{{DE_Address_Berlin_Not_Default_Address.street[0]}}"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!--Set Shipping settings origin data--> |
| 44 | + <actionGroup ref="AdminSetShippingOriginConfigurationActionGroup" stepKey="setShippingOriginConfigurationData"> |
| 45 | + <argument name="address" value="DE_Address_Berlin_Not_Default_Address"/> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!-- Create Simple Product --> |
| 49 | + <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"> |
| 50 | + <field key="price">100</field> |
| 51 | + </createData> |
| 52 | + <!-- Create Cart Price Rule with 10% discount --> |
| 53 | + <createData entity="ApiSalesRule" stepKey="createCartPriceRule"/> |
| 54 | + <!-- Create Coupon code for the Cart Price Rule --> |
| 55 | + <createData entity="ApiSalesRuleCoupon" stepKey="createCartPriceRuleCoupon"> |
| 56 | + <requiredEntity createDataKey="createCartPriceRule"/> |
| 57 | + </createData> |
| 58 | + <!-- Create Customer with filled Shipping & Billing Address --> |
| 59 | + <createData entity="CustomerEntityOne" stepKey="createCustomer"/> |
| 60 | + </before> |
| 61 | + |
| 62 | + <after> |
| 63 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/> |
| 64 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 65 | + <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> |
| 66 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 67 | + <magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.default}}" stepKey="setFreeShippingMethodMinimumOrderAmountAsDefault" /> |
| 68 | + <magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.disabled}}" stepKey="disableFreeShippingMethod" /> |
| 69 | + <!--Reset configs--> |
| 70 | + <magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableCheckout"/> |
| 71 | + <magentoCLI command="config:set {{AdminFedexDisableSandboxModeConfigData.path}} {{AdminFedexDisableSandboxModeConfigData.value}}" stepKey="disableSandbox"/> |
| 72 | + <magentoCLI command="config:set {{AdminFedexDisableDebugConfigData.path}} {{AdminFedexDisableDebugConfigData.value}}" stepKey="disableDebug"/> |
| 73 | + <magentoCLI command="config:set {{AdminFedexDisableShowMethodConfigData.path}} {{AdminFedexDisableShowMethodConfigData.value}}" stepKey="disableShowMethod"/> |
| 74 | + <actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/> |
| 75 | + <actionGroup ref="AdminSetStoreInformationConfigurationActionGroup" stepKey="resetStoreInformationConfig"> |
| 76 | + <argument name="storeName" value=""/> |
| 77 | + <argument name="storeHoursOfOperation" value=""/> |
| 78 | + <argument name="vatNumber" value=""/> |
| 79 | + <argument name="telephone" value=""/> |
| 80 | + <argument name="country" value=""/> |
| 81 | + <argument name="state" value=""/> |
| 82 | + <argument name="city" value=""/> |
| 83 | + <argument name="postcode" value=""/> |
| 84 | + <argument name="street" value=""/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 87 | + </after> |
| 88 | + |
| 89 | + <!-- Guest Customer Test Scenario --> |
| 90 | + <!-- Add Simple Product to Cart --> |
| 91 | + <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart"> |
| 92 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 93 | + </actionGroup> |
| 94 | + |
| 95 | + <!-- Go to Checkout --> |
| 96 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> |
| 97 | + |
| 98 | + <!-- Fill all required fields --> |
| 99 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress"> |
| 100 | + <argument name="customer" value="Simple_Customer_Without_Address" /> |
| 101 | + <argument name="address" value="US_Address_TX"/> |
| 102 | + </actionGroup> |
| 103 | + <waitForLoadingMaskToDisappear stepKey="waitForFreeShippingMethodAppears"/> |
| 104 | + <!-- Select Free Shipping --> |
| 105 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping"> |
| 106 | + <argument name="shippingMethodName" value="Free Shipping"/> |
| 107 | + </actionGroup> |
| 108 | + |
| 109 | + <!-- Go to Order review --> |
| 110 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview"/> |
| 111 | + |
| 112 | + <!-- Checkout select Check/Money Order payment --> |
| 113 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 114 | + <!-- Select payment solution --> |
| 115 | + <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" /> |
| 116 | + <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> |
| 117 | + |
| 118 | + <!-- Apply Discount Coupon to the Order --> |
| 119 | + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon"> |
| 120 | + <argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/> |
| 121 | + </actionGroup> |
| 122 | + |
| 123 | + <!-- Assert Shipping total is not yet calculated --> |
| 124 | + <actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated"/> |
| 125 | + |
| 126 | + <!-- Assert order cannot be placed and error message will shown. --> |
| 127 | + <actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderCannotBePlaced"> |
| 128 | + <argument name="error" value="The shipping method is missing. Select the shipping method and try again."/> |
| 129 | + </actionGroup> |
| 130 | + |
| 131 | + <!-- Go to checkout page --> |
| 132 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/> |
| 133 | + |
| 134 | + <!-- Chose flat rate --> |
| 135 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFlatRate"> |
| 136 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 137 | + </actionGroup> |
| 138 | + |
| 139 | + <!-- Go to Order review --> |
| 140 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutOrderReview"/> |
| 141 | + |
| 142 | + <!-- Place order assert succeed --> |
| 143 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/> |
| 144 | + |
| 145 | + <!-- Loged in Customer Test Scenario --> |
| 146 | + <!-- Login with created Customer --> |
| 147 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 148 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 149 | + </actionGroup> |
| 150 | + |
| 151 | + <!-- Add Simple Product to Cart --> |
| 152 | + <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart"> |
| 153 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 154 | + </actionGroup> |
| 155 | + |
| 156 | + <!-- Go to Checkout --> |
| 157 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="proceedToCheckout"/> |
| 158 | + <waitForLoadingMaskToDisappear stepKey="waitForShippingMethodAppears"/> |
| 159 | + <!-- Select Free Shipping --> |
| 160 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFreeShippingMethod"> |
| 161 | + <argument name="shippingMethodName" value="Free Shipping"/> |
| 162 | + </actionGroup> |
| 163 | + |
| 164 | + <!-- Go to Order review --> |
| 165 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 166 | + |
| 167 | + <!-- Checkout select Check/Money Order payment --> |
| 168 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPaymentMethod"/> |
| 169 | + |
| 170 | + <!-- Select payment solution --> |
| 171 | + <checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="checkBillingAddressNotSameCheckbox"/> |
| 172 | + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButtonVisible"/> |
| 173 | + |
| 174 | + <!-- Apply Discount Coupon to the Order --> |
| 175 | + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCouponCode"> |
| 176 | + <argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/> |
| 177 | + </actionGroup> |
| 178 | + |
| 179 | + <!-- Assert Shipping total is not yet calculated --> |
| 180 | + <actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertShippingTotalNotYetCalculated"/> |
| 181 | + |
| 182 | + <!-- Assert order cannot be placed and error message will shown. --> |
| 183 | + <actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderIsNotPlaced"> |
| 184 | + <argument name="error" value="The shipping method is missing. Select the shipping method and try again."/> |
| 185 | + </actionGroup> |
| 186 | + |
| 187 | + <!-- Go to checkout page --> |
| 188 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutShippingPage"/> |
| 189 | + |
| 190 | + <!-- Chose flat rate --> |
| 191 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"> |
| 192 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 193 | + </actionGroup> |
| 194 | + |
| 195 | + <!-- Go to Order review --> |
| 196 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentStep"/> |
| 197 | + |
| 198 | + <!-- Place order assert succeed --> |
| 199 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 200 | + </test> |
| 201 | +</tests> |
0 commit comments