|
| 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 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminRegisteredUsingPayPalExpressCheckoutMethodAndFlatRateTest"> |
| 12 | + <annotations> |
| 13 | + <features value="PayPal"/> |
| 14 | + <stories value="Checkout Using PayPalExpress Checkout With Payment Action Is Sale"/> |
| 15 | + <title value="Checkout Using PayPalExpress Checkout Method And Flat Rate"/> |
| 16 | + <description value="Create Order Using PayPalExpress Checkout With Payment Action Is Sale."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-6147"/> |
| 19 | + <group value="3rd_party_integration"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create Category and Product --> |
| 23 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 24 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 25 | + <field key="price">10</field> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + <!-- Create Customer --> |
| 29 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 30 | + <!-- Admin Login --> |
| 31 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 32 | + <!-- Enabling PayPal Express Checkout --> |
| 33 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress"> |
| 34 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 35 | + </actionGroup> |
| 36 | + <!-- Changing PayPal Express Checkout Basic Settings --> |
| 37 | + <magentoCLI command="config:set {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.value}}" stepKey="changePaymentAction"/> |
| 38 | + <!--Login to storefront as previously created customer--> |
| 39 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 40 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 41 | + </actionGroup> |
| 42 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 43 | + <argument name="indices" value=""/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 46 | + <argument name="tags" value=""/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnProductPage"> |
| 49 | + <argument name="product" value="$createProduct$"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> |
| 52 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 53 | + <argument name="productQty" value="2"/> |
| 54 | + </actionGroup> |
| 55 | + <!-- Go to Checkout --> |
| 56 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutPage"/> |
| 57 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate"> |
| 58 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 59 | + </actionGroup> |
| 60 | + <!-- Go to Order review --> |
| 61 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 62 | + <waitForElementClickable selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/> |
| 63 | + <click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/> |
| 64 | + <waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/> |
| 65 | + <!-- Click on Paypal paypal button--> |
| 66 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 67 | + <!--Login to Paypal in-context--> |
| 68 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/> |
| 69 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 70 | + <!-- See order successful Page instead of Order Review Page --> |
| 71 | + <waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/> |
| 72 | + <waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/> |
| 73 | + <!--Grab order number--> |
| 74 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 75 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/> |
| 76 | + </before> |
| 77 | + <!--Go to admin sales page and open the order id--> |
| 78 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 79 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 80 | + </actionGroup> |
| 81 | + <!--Assert the total--> |
| 82 | + <waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$30.00" stepKey="checkGrandTotal"/> |
| 83 | + <!--Grab the transaction id--> |
| 84 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/> |
| 85 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/> |
| 86 | + <!--Open comment history tab and assert the comment--> |
| 87 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 88 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Ordered amount')}}" userInput="Ordered amount of $30.00 Transaction ID: "{$grabTransactionID}"" stepKey="seeOrderHistoryNotes"/> |
| 89 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/> |
| 90 | + <!-- Open Invoice and check --> |
| 91 | + <actionGroup ref="AdminOpenInvoiceFromOrderPageActionGroup" stepKey="openInvoiceFromOrder"/> |
| 92 | + <after> |
| 93 | + <!-- delete category and product --> |
| 94 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 95 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 96 | + <!-- Disable PayPal Express Checkout and Basic setting change --> |
| 97 | + <actionGroup ref="AdminPayPalExpressCheckoutDisableActionGroup" stepKey="configPaypalExpressCheckoutDisable"/> |
| 98 | + <magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="paymentActionChangeToAuthorization"/> |
| 99 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 100 | + <!--Delete customer --> |
| 101 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 102 | + <deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/> |
| 103 | + </after> |
| 104 | + </test> |
| 105 | +</tests> |
0 commit comments