|
| 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="StorefrontPaypalExpressCheckoutWithDiscountCoupon"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Paypal express checkout with discount"/> |
| 14 | + <title value="Paypal Express Checkout with discount coupon applied"/> |
| 15 | + <description value="Place an order with discount coupon applied using paypal express checkout as payment method"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-6152"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Simple product is created and assigned to category --> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + <!-- US Customeris created --> |
| 26 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 27 | + |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <!-- <!– Delete all existing cart price rules –>--> |
| 30 | + <!-- <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/>--> |
| 31 | + |
| 32 | + <!-- Create new cart price rule --> |
| 33 | + <actionGroup ref="AdminOpenNewCartPriceRuleFormPageActionGroup" stepKey="createCartPriceRule"/> |
| 34 | + <actionGroup ref="AdminCartPriceRuleFillMainInfoActionGroup" stepKey="selectCustomCustomerGroup"> |
| 35 | + <argument name="name" value="{{CatPriceRule.name}}"/> |
| 36 | + <argument name="description" value="{{CartPriceRuleConditionNotApplied.description}}"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Add discount coupon --> |
| 39 | + <actionGroup ref="AdminCartPriceRuleFillCouponInfoActionGroup" stepKey="fillCartPriceRuleCouponInfo"/> |
| 40 | + <actionGroup ref="AdminCartPriceRuleFillShippingConditionActionGroup" stepKey="setCartAttributeConditionForCartPriceRule"/> |
| 41 | + <!-- Actions header configurations --> |
| 42 | + <conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.actionsHeader}}" visible="true" stepKey="clickToExpandActions"/> |
| 43 | + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> |
| 44 | + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="20" stepKey="fillDiscountAmount"/> |
| 45 | + <actionGroup ref="AdminCartPriceRuleSaveActionGroup" stepKey="saveCartPriceRule"/> |
| 46 | + <!-- end of create cart price rule --> |
| 47 | + |
| 48 | + </before> |
| 49 | + <after> |
| 50 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 51 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 52 | + <magentoCLI command="config:set payment/wps_express/active 0" stepKey="disableWPSExpress"/> |
| 53 | + <magentoCLI command="config:set payment/hosted_pro/active 0" stepKey="disableHostedProExpress"/> |
| 54 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 55 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 56 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 57 | + </after> |
| 58 | + <!-- Login to StoreFront --> |
| 59 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 60 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 61 | + </actionGroup> |
| 62 | + <!-- Add product to cart --> |
| 63 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 64 | + <argument name="product" value="$$createProduct$$"/> |
| 65 | + </actionGroup> |
| 66 | + <!-- Goto Checkout Page --> |
| 67 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/> |
| 68 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="checkFlatRateShippingMethod" /> |
| 69 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> |
| 70 | + |
| 71 | + <!-- Apply Discount Coupon to the Order --> |
| 72 | + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon"> |
| 73 | + <argument name="discountCode" value="{{_defaultCoupon.code}}"/> |
| 74 | + </actionGroup> |
| 75 | + |
| 76 | + <!-- click on PayPal payment radio button --> |
| 77 | + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> |
| 78 | + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="guestSelectCheckMoneyOrderPayment"/> |
| 79 | + |
| 80 | + <!--Click Paypal button--> |
| 81 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 82 | + |
| 83 | + <!--Login to Paypal in-context--> |
| 84 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/> |
| 85 | + <!--Transfer Cart Line and Shipping Method assertion--> |
| 86 | + <actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/> |
| 87 | + |
| 88 | + <!--Click PayPal button and go back to Magento site--> |
| 89 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/> |
| 90 | + <actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/> |
| 91 | + <!-- I see order successful Page instead of Order Review Page --> |
| 92 | + <actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertCheckoutSuccess"/> |
| 93 | + |
| 94 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 95 | + </test> |
| 96 | +</tests> |
0 commit comments