|
| 1 | +<?xml version="1.0" encoding="UTF-8"?><!-- |
| 2 | + /** |
| 3 | + * Copyright © Magento, Inc. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
| 5 | + */ |
| 6 | +--> |
| 7 | + |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="StorefrontFreeShippingShouldNotApplyIfOtherDiscountAppliedTest"> |
| 10 | + <annotations> |
| 11 | + <features value="Shipping"/> |
| 12 | + <stories value="Offline Shipping Methods"/> |
| 13 | + <title value="Free Shipping Should Not Applicable if Other Discount Reduce the Matching Amount"/> |
| 14 | + <description value="Free Shipping Should Not Applicable if Other Discount Reduce the Matching Amount"/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <testCaseId value="AC-7886"/> |
| 17 | + <group value="shipping"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Create cart price rule --> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 22 | + <!--Create active cart price rule--> |
| 23 | + <actionGroup ref="AdminCreateCartPriceRuleActionsWithSubtotalExclTaxActionGroup" stepKey="createFreeShippingCartPriceRule"> |
| 24 | + <argument name="ruleName" value="CartPriceRuleFreeShippingAppliedOnly"/> |
| 25 | + </actionGroup> |
| 26 | + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> |
| 27 | + <argument name="ruleName" value="CartPriceRuleConditionWithCouponAppliedForSubtotalExclTax"/> |
| 28 | + <argument name="couponCode" value="CartPriceRuleConditionWithCouponAppliedForSubtotalExclTax.coupon_code"/> |
| 29 | + </actionGroup> |
| 30 | + <!-- Add simple product --> |
| 31 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> |
| 32 | + <field key="price">100.00</field> |
| 33 | + </createData> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteFreeShippingCartPriceRule"> |
| 37 | + <argument name="ruleName" value="{{CartPriceRuleFreeShippingAppliedOnly.name}}"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> |
| 40 | + <argument name="ruleName" value="{{CartPriceRuleConditionWithCouponAppliedForSubtotalExclTax.name}}"/> |
| 41 | + </actionGroup> |
| 42 | +<!-- Remove simple product--> |
| 43 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 44 | + |
| 45 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 46 | + </after> |
| 47 | + <!-- Add simple product to cart --> |
| 48 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 49 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Assert that table rate value is correct for US --> |
| 53 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/> |
| 54 | + <waitForElement time="30" selector="{{CheckoutCartSummarySection.estimateShippingAndTaxForm}}" stepKey="waitForEstimateShippingAndTaxForm"/> |
| 55 | + <waitForElement time="30" selector="{{CheckoutCartSummarySection.shippingMethodForm}}" stepKey="waitForShippingMethodForm"/> |
| 56 | + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> |
| 57 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$0.00" stepKey="seeFlatShippingZero"/> |
| 58 | + |
| 59 | + <!-- Apply Discount Coupon to the Order --> |
| 60 | + <actionGroup ref="StorefrontShoppingCartClickApplyDiscountButtonActionGroup" stepKey="clickApplyButton"/> |
| 61 | + <actionGroup ref="StorefrontShoppingCartFillCouponCodeFieldActionGroup" stepKey="fillDiscountCodeField"> |
| 62 | + <argument name="discountCode" value="{{CartPriceRuleConditionWithCouponAppliedForSubtotalExclTax.coupon_code}}"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="StorefrontShoppingCartClickApplyDiscountButtonActionGroup" stepKey="clickApplyDiscountButton"/> |
| 65 | + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertSuccessMessage"> |
| 66 | + <argument name="message" value='You used coupon code "{{CartPriceRuleConditionWithCouponAppliedForSubtotalExclTax.coupon_code}}".'/> |
| 67 | + </actionGroup> |
| 68 | + <waitForElement time="30" selector="{{CheckoutCartSummarySection.estimateShippingAndTaxForm}}" stepKey="waitForEstimateShippingAndTaxFormAfterCouponApplied"/> |
| 69 | + <waitForElement time="30" selector="{{CheckoutCartSummarySection.shippingMethodForm}}" stepKey="waitForShippingMethodFormAfterCouponApplied"/> |
| 70 | + <see selector="{{CheckoutCartSummarySection.shippingPrice}}" userInput="$5.00" stepKey="seeFlatShippingPrice"/> |
| 71 | + </test> |
| 72 | +</tests> |
0 commit comments