|
| 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="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Checkout Free Shipping Recalculation after Coupon Code Added"/> |
| 13 | + <stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/> |
| 14 | + <description value="User should be able to do checkout free shipping recalculation after adding coupon code"/> |
| 15 | + <features value="Checkout"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MAGETWO-96537"/> |
| 18 | + <useCaseId value="MAGETWO-96431"/> |
| 19 | + <group value="Checkout"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"> |
| 25 | + <field key="group_id">1</field> |
| 26 | + </createData> |
| 27 | + <createData entity="_defaultCategory" stepKey="defaultCategory"/> |
| 28 | + <createData entity="_defaultProduct" stepKey="simpleProduct"> |
| 29 | + <field key="price">90</field> |
| 30 | + <requiredEntity createDataKey="defaultCategory"/> |
| 31 | + </createData> |
| 32 | + <!--It is default for FlatRate--> |
| 33 | + <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> |
| 34 | + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> |
| 35 | + <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> |
| 36 | + <magentoCLI command="cache:flush" stepKey="flushCache1"/> |
| 37 | + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createCartPriceRule"> |
| 38 | + <argument name="ruleName" value="CatPriceRule"/> |
| 39 | + <argument name="couponCode" value="CatPriceRule.coupon_code"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront"> |
| 42 | + <argument name="Customer" value="$$createSimpleUsCustomer$$"/> |
| 43 | + </actionGroup> |
| 44 | + <amOnPage url="$$simpleProduct.name$$.html" stepKey="navigateToProductPage"/> |
| 45 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 46 | + </before> |
| 47 | + <after> |
| 48 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 49 | + <deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/> |
| 50 | + <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> |
| 51 | + <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> |
| 52 | + <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> |
| 53 | + <magentoCLI command="cache:flush" stepKey="flushCache2"/> |
| 54 | + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> |
| 55 | + <argument name="ruleName" value="{{CatPriceRule.name}}"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="logout" stepKey="logout"/> |
| 58 | + </after> |
| 59 | + |
| 60 | + <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule"> |
| 61 | + <argument name="product" value="$$simpleProduct$$"/> |
| 62 | + <argument name="couponCode" value="{{CatPriceRule.coupon_code}}"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/> |
| 65 | + <waitForPageLoad stepKey="waitForpageLoad1"/> |
| 66 | + <dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/> |
| 67 | + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage"/> |
| 68 | + <waitForPageLoad stepKey="waitForShoppingCartPage"/> |
| 69 | + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickIfDiscountTabClosed1"/> |
| 70 | + <waitForPageLoad stepKey="waitForCouponTabOpen1"/> |
| 71 | + <click selector="{{DiscountSection.CancelCoupon}}" stepKey="cancelCoupon"/> |
| 72 | + <waitForPageLoad stepKey="waitForCancel"/> |
| 73 | + <see userInput='You canceled the coupon code.' stepKey="seeCancellationMessage"/> |
| 74 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/> |
| 75 | + <waitForPageLoad stepKey="waitForShippingMethods"/> |
| 76 | + <click stepKey="chooseFreeShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}"/> |
| 77 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext1"/> |
| 78 | + <waitForPageLoad stepKey="waitForReviewAndPayments1"/> |
| 79 | + <conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickIfDiscountTabClosed2"/> |
| 80 | + <waitForPageLoad stepKey="waitForCouponTabOpen2"/> |
| 81 | + <fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{CatPriceRule.coupon_code}}" stepKey="fillCouponCode"/> |
| 82 | + <click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="applyCode"/> |
| 83 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 84 | + <see userInput="Your coupon was successfully applied." stepKey="seeSuccessMessage"/> |
| 85 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/> |
| 86 | + <waitForPageLoad stepKey="waitForError"/> |
| 87 | + <see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/> |
| 88 | + <amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/> |
| 89 | + <waitForPageLoad stepKey="waitForShippingPageLoad"/> |
| 90 | + <click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/> |
| 91 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext2"/> |
| 92 | + <waitForPageLoad stepKey="waitForReviewAndPayments2"/> |
| 93 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/> |
| 94 | + <waitForPageLoad stepKey="waitForSuccessfullyPlacedOrder"/> |
| 95 | + <see stepKey="seeSuccessMessageForPlacedOrder" userInput="Thank you for your purchase!"/> |
| 96 | + </test> |
| 97 | +</tests> |
0 commit comments