|
| 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="PlaceOrderUsingPaypalExpressWithPaymentActionOrderTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Place order using Paypal Express with Payment Action as Order"/> |
| 15 | + <description value="Placing an order with paypal express checkout payment option and the payment action as Ordered and assert the data in order page of admin. "/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-6159"/> |
| 18 | + <group value="3rd_party_integration" /> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleProduct" stepKey="simpleProduct"/> |
| 22 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 23 | + <magentoCLI command="config:set {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.value}}" stepKey="setPaymentActionOrder"/> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress"> |
| 26 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 27 | + </actionGroup> |
| 28 | + </before> |
| 29 | + <after> |
| 30 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 31 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 32 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 33 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> |
| 34 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + <!--Go to storefront and add product to cart --> |
| 37 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 38 | + <argument name="Customer" value="$createCustomer$" /> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> |
| 41 | + <argument name="product" value="$$simpleProduct$$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart"> |
| 44 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 45 | + </actionGroup> |
| 46 | + <!--<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 47 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>--> |
| 48 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="onCheckout"/> |
| 49 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate"> |
| 50 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Go to Order review --> |
| 53 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 54 | + <waitForElement selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/> |
| 55 | + <click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/> |
| 56 | + <waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/> |
| 57 | + <wait time="120" stepKey="waiting"/> |
| 58 | + <!-- Click on Paypal paypal button--> |
| 59 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 60 | + <!--Login to Paypal in-context--> |
| 61 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/> |
| 62 | + <!--Transfer Cart Line and Shipping Method assertion--> |
| 63 | + <actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/> |
| 64 | + <!--Click PayPal button and go back to Magento site--> |
| 65 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/> |
| 66 | + <!-- I see order successful Page instead of Order Review Page --> |
| 67 | + <waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/> |
| 68 | + <waitForElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/> |
| 69 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 70 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/> |
| 71 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 72 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 73 | + </actionGroup> |
| 74 | + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$128.00" stepKey="checkGrandTotal"/> |
| 75 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/> |
| 76 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/> |
| 77 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 78 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Ordered amount')}}" userInput="Ordered amount of $128.00 Transaction ID: "{$grabTransactionID}"" stepKey="seeOrderHistoryNotes"/> |
| 79 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderStatus}}" userInput="Processing" stepKey="assertOrderStatusInCommentsHistorySection"/> |
| 80 | + <!--Assert Authorize button is present and Invoice button is absent--> |
| 81 | + <actionGroup ref="AdminAssertAuthorizeButtonOnOrderPageActionGroup" stepKey="assertAuthorizeButtonIsPresent"/> |
| 82 | + <dontSee selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="dontSeeInvoiceButton"/> |
| 83 | + <!--Open transaction tab and assert transaction type is order--> |
| 84 | + <actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionType"> |
| 85 | + <argument name="transactionType" value="order"/> |
| 86 | + </actionGroup> |
| 87 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 88 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 89 | + <!--Hold and unhold the order--> |
| 90 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="waitForHoldButtonToBeClickable"/> |
| 91 | + <click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="clickHoldButton"/> |
| 92 | + <dontSee selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="dontSeeAuthorizationButton"/> |
| 93 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.unhold}}" stepKey="waitForUnHoldButtonToBeClickable"/> |
| 94 | + <click selector="{{AdminOrderDetailsMainActionsSection.unhold}}" stepKey="clickUnHoldButton"/> |
| 95 | + <actionGroup ref="AdminAssertAuthorizeButtonOnOrderPageActionGroup" stepKey="assertAuthorizeButtonIsPresentAfterUnHolding"/> |
| 96 | + <!--Authorize the order--> |
| 97 | + <actionGroup ref="AdminAuthorizeAnOrderActionGroup" stepKey="authorizeTheOrder"/> |
| 98 | + <!--Open Comments history tab and seert the comment for authorization--> |
| 99 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppeared"/> |
| 100 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/> |
| 101 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterAuthorizing"/> |
| 102 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Authorized amount')}}" userInput="Authorized amount of $128.00. Transaction ID: "{$grabLastTransactionID}"" stepKey="seeOrderHistoryNotesAfterAuthorizing"/> |
| 103 | + <dontSee selector="{{AdminOrderDetailsMainActionsSection.authorize}}" stepKey="dontSeeAuthorizationButtonAfterAuthorizing"/> |
| 104 | + <waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoiceButtonToBeAppeared"/> |
| 105 | + <waitForElement selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="assertInvoiceButtonIsPresent"/> |
| 106 | + <actionGroup ref="AdminAssertTransactionTypeInTransactionTabActionGroup" stepKey="assertTransactionTypeHasAuthorization"> |
| 107 | + <argument name="transactionType" value="authorization"/> |
| 108 | + </actionGroup> |
| 109 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClickedAfterAsserting"/> |
| 110 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButtonAfterAsserting"/> |
| 111 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/> |
| 112 | + <seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType"/> |
| 113 | + <!--Submit creating invoice into the order--> |
| 114 | + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoiceIntoOrder"/> |
| 115 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus"> |
| 116 | + <argument name="status" value="Processing"/> |
| 117 | + </actionGroup> |
| 118 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 119 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 120 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/> |
| 121 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $128.00 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/> |
| 122 | + </test> |
| 123 | +</tests> |
0 commit comments