|
| 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="EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Enable paypal express checkout and validate the customer checkout payment works with paypal express"/> |
| 14 | + <title value="Enable paypal express checkout and validate the customer checkout payment works with paypal express"/> |
| 15 | + <description value="Enable paypal express checkout and validate the customer checkout payment works with paypal express"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-6951"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!--Enable free shipping method --> |
| 21 | + <magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + <!-- New Customer --> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"> |
| 25 | + <field key="firstname">John1</field> |
| 26 | + <field key="lastname">Doe1</field> |
| 27 | + </createData> |
| 28 | + <createData entity="SimpleProduct2" stepKey="simpleProduct"> |
| 29 | + <field key="price">1</field> |
| 30 | + </createData> |
| 31 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress"> |
| 32 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 33 | + </actionGroup> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/> |
| 37 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 38 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 39 | + <magentoCLI command="config:set payment/wps_express/active 0" stepKey="disableWPSExpress"/> |
| 40 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 41 | + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> |
| 42 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 43 | + </after> |
| 44 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser"> |
| 45 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 48 | + <argument name="product" value="$simpleProduct$"/> |
| 49 | + </actionGroup> |
| 50 | + <!--Go to cart page--> |
| 51 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> |
| 52 | + <!-- Click on Paypal paypal button--> |
| 53 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"> |
| 54 | + <argument name="elementNumber" value="1"/> |
| 55 | + </actionGroup> |
| 56 | + <!--Login to Paypal in-context--> |
| 57 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/> |
| 58 | + <!--Transfer Cart Line and Shipping Method assertion--> |
| 59 | + <actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/> |
| 60 | + <!--Click PayPal button and go back to Magento site--> |
| 61 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/> |
| 62 | + <actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod"> |
| 63 | + <argument name="shippingMethod" value="Free - $0.00"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/> |
| 66 | + <!-- I see order successful Page instead of Order Review Page --> |
| 67 | + <actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertCheckoutSuccess"/> |
| 68 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 69 | + <!--Go to Admin and check order information--> |
| 70 | + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid"> |
| 71 | + <argument name="orderId" value="$grabOrderNumber"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> |
| 74 | + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/> |
| 75 | + </test> |
| 76 | +</tests> |
0 commit comments