|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /************************************************************************ |
| 4 | + * |
| 5 | + * Copyright 2024 Adobe |
| 6 | + * All Rights Reserved. |
| 7 | + * |
| 8 | + * NOTICE: All information contained herein is, and remains |
| 9 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 10 | + * and technical concepts contained herein are proprietary to Adobe |
| 11 | + * and its suppliers and are protected by all applicable intellectual |
| 12 | + * property laws, including trade secret and copyright laws. |
| 13 | + * Dissemination of this information or reproduction of this material |
| 14 | + * is strictly forbidden unless prior written permission is obtained |
| 15 | + * from Adobe. |
| 16 | + * ************************************************************************ |
| 17 | + */ |
| 18 | + --> |
| 19 | + |
| 20 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 22 | + <test name="StorefrontAssertShippingPricesPresentWithFreeShippingAfterApplyingCartRuleTest"> |
| 23 | + <annotations> |
| 24 | + <features value="Shipping"/> |
| 25 | + <stories value="Cart price rules"/> |
| 26 | + <title value="Assert that table rate shipping price will be correct after cart price rule for free shipping applied"/> |
| 27 | + <description value="Table rate price should be displayed correctly on checkout after applied free shipment cart price rule"/> |
| 28 | + <severity value="AVERAGE"/> |
| 29 | + <testCaseId value="AC-11402"/> |
| 30 | + <useCaseId value="ACP2E-2763"/> |
| 31 | + <group value="shipping"/> |
| 32 | + <group value="SalesRule"/> |
| 33 | + <group value="cloud"/> |
| 34 | + </annotations> |
| 35 | + <before> |
| 36 | + <createData entity="ApiSimpleProductWithCustomPrice" stepKey="createProduct"/> |
| 37 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 38 | + <!-- Enable free shipping method --> |
| 39 | + <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> |
| 40 | + <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> |
| 41 | + |
| 42 | + <!-- Turn on and configure table rates shipping method --> |
| 43 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> |
| 44 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite"> |
| 45 | + <argument name="website" value="_defaultWebsite"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethodForDefaultWebsite"> |
| 48 | + <argument name="status" value="1"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="AdminChangeTableRatesShippingMethodConditionActionGroup" stepKey="selectPriceVsDestinationCondition"> |
| 51 | + <argument name="condition" value="{{TableRateShippingMethodConfig.package_value_with_discount}}"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="AdminImportFileTableRatesShippingMethodActionGroup" stepKey="importCSVFile"> |
| 54 | + <argument name="file" value="price_tablerates.csv"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> |
| 57 | + |
| 58 | + <!-- Create cart price rule for free shipping --> |
| 59 | + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllExistingCartPriceRules"/> |
| 60 | + |
| 61 | + <actionGroup ref="AdminOpenNewCartPriceRuleFormPageActionGroup" stepKey="createCartPriceRule"/> |
| 62 | + <actionGroup ref="AdminCartPriceRuleFillMainInfoActionGroup" stepKey="fillCartPriceRuleMainInfo"> |
| 63 | + <argument name="name" value="{{CartPriceRuleFreeShippingWithCouponAppliedOnly.name}}"/> |
| 64 | + <argument name="description" value="{{CartPriceRuleFreeShippingWithCouponAppliedOnly.description}}"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="AdminCartPriceRuleFillCouponInfoActionGroup" stepKey="fillCartPriceRuleCouponInfo"/> |
| 67 | + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="fillCartPriceRuleActionsSection"> |
| 68 | + <argument name="rule" value="CartPriceRuleFreeShippingWithCouponAppliedOnly"/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup" stepKey="fillCartPriceRuleFreeShippingActionsSection"> |
| 71 | + <argument name="freeShippingOption" value="{{CartPriceRuleFreeShippingWithCouponAppliedOnly.simple_free_shipping}}"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="AdminCartPriceRuleSaveActionGroup" stepKey="saveCartPriceRule"/> |
| 74 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/> |
| 75 | + </before> |
| 76 | + <after> |
| 77 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin2"/> |
| 78 | + |
| 79 | + <!-- Delete product --> |
| 80 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 81 | + |
| 82 | + <!-- Delete cart price rule for free shipping --> |
| 83 | + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> |
| 84 | + |
| 85 | + <!-- Disable free shipping method --> |
| 86 | + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage2"/> |
| 87 | + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/> |
| 88 | + <createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/> |
| 89 | + |
| 90 | + <!-- Turn off table rates shipping method --> |
| 91 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="switchDefaultWebsite2"> |
| 92 | + <argument name="website" value="_defaultWebsite"/> |
| 93 | + </actionGroup> |
| 94 | + <actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="disableTableRatesShippingMethodForDefaultWebsite"> |
| 95 | + <argument name="status" value="0"/> |
| 96 | + </actionGroup> |
| 97 | + <checkOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateConditionName}}" stepKey="disableUseDefaultCondition"/> |
| 98 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig2"/> |
| 99 | + |
| 100 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout2"/> |
| 101 | + </after> |
| 102 | + |
| 103 | + <!-- Add product to cart and check shipping prices --> |
| 104 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage"> |
| 105 | + <argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/> |
| 106 | + </actionGroup> |
| 107 | + |
| 108 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 109 | + <argument name="product" value="$createProduct$" /> |
| 110 | + <argument name="productCount" value="1" /> |
| 111 | + </actionGroup> |
| 112 | + |
| 113 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 114 | + |
| 115 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="guestCheckoutFillingShippingSection"> |
| 116 | + <argument name="customer" value="CustomerEntityOne" /> |
| 117 | + <argument name="address" value="CustomerAddressSimple" /> |
| 118 | + </actionGroup> |
| 119 | + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Fixed')}}" userInput="$5.00" stepKey="assertFlatRatedMethodPrice"/> |
| 120 | + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Table Rate')}}" userInput="$0.00" stepKey="assertTableRatedMethodPrice"/> |
| 121 | + <dontSee selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Free Shipping')}}" userInput="$0.00" stepKey="assertFreeShippingMethodNotAvailable"/> |
| 122 | + <waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRateShippingMethod"/> |
| 123 | + |
| 124 | + <!-- Apply cart price rule for free shipping --> |
| 125 | + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" stepKey="selectFlatRateShippingMethod"/> |
| 126 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="goToPaymentStep"/> |
| 127 | + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCoupon"> |
| 128 | + <argument name="discountCode" value="{{_defaultCoupon.code}}"/> |
| 129 | + </actionGroup> |
| 130 | + |
| 131 | + <!-- Check shipping prices after applying cart price rule --> |
| 132 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePageAfterCartRuleApplied"/> |
| 133 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> |
| 134 | + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Fixed')}}" userInput="$5.00" stepKey="assertFlatRatedMethodPriceAfterCartRule"/> |
| 135 | + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Table Rate')}}" userInput="$15.95" stepKey="assertTableRatedMethodPriceAfterCartRule"/> |
| 136 | + <see selector="{{CheckoutShippingMethodsSection.shippingRatePriceByName('Free Shipping')}}" userInput="$0.00" stepKey="assertFreeShippingMethodAvailable"/> |
| 137 | + </test> |
| 138 | +</tests> |
0 commit comments