|
| 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="AdminCancelSalesOrderPlacedWithPayPalPaymentsProTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Paypal Payments Pro"/> |
| 14 | + <title value="Cancel a Sales Order placed with PayPal Payments Pro"/> |
| 15 | + <description value="Cancel a Sales Order placed with PayPal Payments Pro and validate message in trasaction tab from backend "/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4772"/> |
| 18 | + <group value="paypalPaymentsPro"/> |
| 19 | + <group value="3rd_party_integration"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <!-- Go to product 1 and add it to cart --> |
| 25 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 26 | + <argument name="indices" value=""/> |
| 27 | + </actionGroup> |
| 28 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 29 | + <argument name="tags" value=""/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> |
| 32 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 35 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 38 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 39 | + <!--Place order--> |
| 40 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 41 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup" stepKey="selectPaypalPaymentMethod"/> |
| 44 | + <waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> |
| 45 | + <actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal"> |
| 46 | + <argument name="cardData" value="VisaDefaultCard"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 49 | + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> |
| 50 | + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> |
| 51 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumber"/> |
| 52 | + </before> |
| 53 | + <after> |
| 54 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 55 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnRemoveButtonToUnFiltersIfPresent"/> |
| 56 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 57 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 58 | + </after> |
| 59 | + <!--Open order in sales --> |
| 60 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 61 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 62 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> |
| 65 | + <argument name="orderStatus" value="Canceled"/> |
| 66 | + </actionGroup> |
| 67 | + <!--Grab the transaction id--> |
| 68 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/> |
| 69 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/> |
| 70 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 71 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Canceled order')}}" userInput="Canceled order online Amount: $128.00. Transaction ID: "{$grabTransactionID}"" stepKey="seeOrderHistoryNotesAfterCancelingOrder"/> |
| 72 | + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasAuthorization"> |
| 73 | + <argument name="transactionType" value="authorization"/> |
| 74 | + </actionGroup> |
| 75 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> |
| 76 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 77 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 78 | + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasVoid"> |
| 79 | + <argument name="transactionType" value="void"/> |
| 80 | + </actionGroup> |
| 81 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/> |
| 82 | + </test> |
| 83 | +</tests> |
0 commit comments