|
| 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="AdminCreatePartialCaptureOrderWithPaypalStandardTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Create Partial Capture for Order Paid with PayPal Payments Standard"/> |
| 15 | + <description value="Create Partial Capture for Order Paid with PayPal Payments Standard"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-5161"/> |
| 18 | + <group value="paypalStandard"/> |
| 19 | + <group value="3rd_party_integration" /> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Login to admin--> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <!-- Simple product is created --> |
| 25 | + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"> |
| 26 | + <field key="price">125.15</field> |
| 27 | + </createData> |
| 28 | + <!-- US Customer is created --> |
| 29 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 30 | + <!-- Reindexing and flushing Cache--> |
| 31 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexConfig"> |
| 32 | + <argument name="indices" value=""/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheConfig"> |
| 35 | + <argument name="tags" value="config full_page"/> |
| 36 | + </actionGroup> |
| 37 | + <!-- Open Product Page to add product in the cart --> |
| 38 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnProductPage"> |
| 39 | + <argument name="product" value="$createProduct$"/> |
| 40 | + </actionGroup> |
| 41 | + <scrollTo selector="{{StorefrontProductActionSection.quantity}}" stepKey="scrollToQuantityField"/> |
| 42 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> |
| 43 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 44 | + <argument name="productQty" value="2"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 47 | + <!--Fill Shipping Address--> |
| 48 | + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/> |
| 49 | + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="Texas" stepKey="fillState"/> |
| 50 | + <waitForPageLoad stepKey="waitForShippingPageToLoad"/> |
| 51 | + <!-- Click Next button --> |
| 52 | + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> |
| 53 | + <!-- Click on PayPal payment radio button and click on continue btn --> |
| 54 | + <actionGroup ref="AdminSelectPaypalStandardPaymentInPaymentPageActionGroup" stepKey="selectPaypalStandardPaymentAndClickOnContinuebtn"/> |
| 55 | + <!-- Login to Paypal in-context and verify order total on paypal page--> |
| 56 | + <actionGroup ref="DummyDataActionGroup" stepKey="loginToPayPal"/> |
| 57 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 58 | + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> |
| 59 | + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> |
| 60 | + </before> |
| 61 | + <after> |
| 62 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 63 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 64 | + <!-- Logout--> |
| 65 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 66 | + </after> |
| 67 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 68 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 69 | + <!-- Go to order page --> |
| 70 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> |
| 71 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 72 | + </actionGroup> |
| 73 | + <!--Submit invoice--> |
| 74 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/> |
| 75 | + <!--Update qty as 1 and assert the status of the order--> |
| 76 | + <actionGroup ref="AdminFillQtyToInvoiceOnCreateInvoicePageActionGroup" stepKey="fillInvoiceQuantity"> |
| 77 | + <argument name="qty" value="1"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="AdminClickUpdateQtysButtonOnCreateInvoicePageActionGroup" stepKey="clickUpdateQtyAfterUpdatingInvoiceBtn"/> |
| 80 | + <waitForPageLoad stepKey="waitPageToBeLoaded" after="clickUpdateQtyAfterUpdatingInvoiceBtn"/> |
| 81 | + <seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType" after="waitPageToBeLoaded"/> |
| 82 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> |
| 83 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus"> |
| 84 | + <argument name="status" value="Processing"/> |
| 85 | + </actionGroup> |
| 86 | + <waitForPageLoad stepKey="waitForOrderInformationTabLoadingMask"/> |
| 87 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 88 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 89 | + <waitForPageLoad stepKey="waitUntilInvoiceTabIsOpened"/> |
| 90 | + <!--Open invoice tab and verify the invoice is present--> |
| 91 | + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickOrderInvoicesTab"/> |
| 92 | + <waitForLoadingMaskToDisappear stepKey="waitForInvoiceGridLoadingMask" /> |
| 93 | + <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="{{Simple_US_Customer.firstname}}" stepKey="seeOrderInvoiceInTabGrid"/> |
| 94 | + <waitForElementClickable selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="waitForClickToViewInvoiceRow"/> |
| 95 | + <conditionalClick selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" dependentSelector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" visible="true" stepKey="clickToViewInvoiceRow"/> |
| 96 | + <see selector="{{AdminInvoiceOrderInformationSection.orderId}}" userInput="{$grabOrderNumber}" stepKey="seeOrderIdOnInvoice" /> |
| 97 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openAgainOrderPage"> |
| 98 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 99 | + </actionGroup> |
| 100 | + <!--Open the comment history tab and assert the comment--> |
| 101 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/> |
| 102 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $135.15 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/> |
| 103 | + <!-- Check the last transaction of the order and validate the details for Captured and Authorization--> |
| 104 | + <actionGroup ref="AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey="validateAuthTransaction"/> |
| 105 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="No" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> |
| 106 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 107 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 108 | + <actionGroup ref="AdminAssertTransitionTypeStatusNewActionGroup" stepKey="assertTransactionTypeStatusForCapture"> |
| 109 | + <argument name="transactionType" value="capture"/> |
| 110 | + <argument name="transitionTypeStatus" value="No"/> |
| 111 | + </actionGroup> |
| 112 | + </test> |
| 113 | +</tests> |
0 commit comments