|
| 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="AdminPartialCaptureForPaypalCreditPaymentTest" extends="StorefrontGuestCheckoutUsingPaypalPayFlowLinkTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Paypal pay flow configuration"/> |
| 14 | + <title value="Create partial capture for order paid with PayPal Payflow"/> |
| 15 | + <description value="Admin creates partial capture for order paid with PayPal Payflow Pro and assert the transaction in transaction tab"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4833"/> |
| 18 | + <group value="3rd_party_integration"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <remove keyForRemoval="addProductToCart"/> |
| 22 | + <!-- Simple product is created --> |
| 23 | + <createData entity="SimpleProduct" stepKey="createProduct" before ="ConfigPayPalPayFlowLink"> |
| 24 | + <field key="price">125.15</field> |
| 25 | + </createData> |
| 26 | + </before> |
| 27 | + <remove keyForRemoval="addProductToCart"/> |
| 28 | + <remove keyForRemoval="assertOrderDetails"/> |
| 29 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addItemToCart" before="goToCheckout"> |
| 30 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 31 | + <argument name="productQty" value="2"/> |
| 32 | + </actionGroup> |
| 33 | + <remove keyForRemoval="seeAdminOrderStatus"/> |
| 34 | + <remove keyForRemoval="checkGrandTotal"/> |
| 35 | + <remove keyForRemoval="clickOnCommentsHistory"/> |
| 36 | + <remove keyForRemoval="seeOrderHistoryNotes"/> |
| 37 | + <!--Submit invoice--> |
| 38 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton" after="openFirstOrderPage"/> |
| 39 | + <seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType"/> |
| 40 | + <!--Update qty as 1 and assert the status of the order--> |
| 41 | + <actionGroup ref="AdminFillQtyToInvoiceOnCreateInvoicePageActionGroup" stepKey="fillInvoiceQuantity"> |
| 42 | + <argument name="qty" value="1"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminClickUpdateQtysButtonOnCreateInvoicePageActionGroup" stepKey="clickUpdateQtyAfterUpdatingInvoiceBtn"/> |
| 45 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickOnSubmitInvoice"/> |
| 46 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus"> |
| 47 | + <argument name="status" value="Processing"/> |
| 48 | + </actionGroup> |
| 49 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 50 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 51 | + <!--Open invoice tab and verify the invoice is present--> |
| 52 | + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickOrderInvoicesTab"/> |
| 53 | + <waitForLoadingMaskToDisappear stepKey="waitForInvoiceGridLoadingMask" /> |
| 54 | + <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="{{Simple_US_Customer.firstname}}" stepKey="seeOrderInvoiceInTabGrid"/> |
| 55 | + <waitForElementClickable selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="waitForClickToViewInvoiceRow"/> |
| 56 | + <conditionalClick selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" dependentSelector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" visible="true" stepKey="clickToViewInvoiceRow"/> |
| 57 | + <see selector="{{AdminInvoiceOrderInformationSection.orderId}}" userInput="{$grabOrderNumber}" stepKey="seeOrderIdOnInvoice" /> |
| 58 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openAgainOrderPage"> |
| 59 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 60 | + </actionGroup> |
| 61 | + <!--Open the comment history tab and assert the comment--> |
| 62 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/> |
| 63 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $135.15 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/> |
| 64 | + <!-- Check the last transaction of the order and validate the details for Captured and Authorization--> |
| 65 | + <actionGroup ref="AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey="validateAuthTransaction"/> |
| 66 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="No" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> |
| 67 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 68 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 69 | + <actionGroup ref="AdminAssertTransitionTypeStatusNewActionGroup" stepKey="assertTransactionTypeStatusForCapture"> |
| 70 | + <argument name="transactionType" value="capture"/> |
| 71 | + <argument name="transitionTypeStatus" value="No"/> |
| 72 | + </actionGroup> |
| 73 | + </test> |
| 74 | +</tests> |
| 75 | + |
0 commit comments