|
| 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="StorefrontPartialCaptureInvoiceForPaypalExpressPayflowEditionTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Partial Capture Order with Payflow Edition"/> |
| 14 | + <title value="Partial Capture for a sales order placed with PayPal Express Checkout (Payflow Edition)"/> |
| 15 | + <description value="Place an order with Paypal express checkout payflow edition as payment method and Partial Capture the Order"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4846"/> |
| 18 | + <group value="3rd_party_integration"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Simple product is created --> |
| 22 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 23 | + <field key="price">125.15</field> |
| 24 | + </createData> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createAnotherProduct"/> |
| 26 | + <!-- US Customer is created --> |
| 27 | + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <!-- Configure PayPal Express Checkout --> |
| 30 | + <actionGroup ref="AdminConfigPaymentAdvancedThroughCLIActionGroup" stepKey="ConfigPaymentAdvanced"/> |
| 31 | + <actionGroup ref="AdminConfigurationPaymentAdvancedActionGroup" stepKey="setValuesForUserAndPwd"/> |
| 32 | + <magentoCLI command="config:set payment/payflow_advanced/active 1" stepKey="enablePaymentAdvancedSolution"/> |
| 33 | + <magentoCLI command="config:set payment/payflow_express_bml/active 1" stepKey="enablePaypalCredit"/> |
| 34 | + <magentoCLI command="config:set payment/payflow_express/active 1" stepKey="enablePayflowExpress"/><actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 35 | + <argument name="indices" value=""/> |
| 36 | + </actionGroup> |
| 37 | + <!-- Login to StoreFront --> |
| 38 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 39 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 40 | + </actionGroup> |
| 41 | + <!-- Open Product Page to add product in the cart --> |
| 42 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="amOnProductPage"> |
| 43 | + <argument name="product" value="$createProduct$"/> |
| 44 | + </actionGroup> |
| 45 | + <scrollTo selector="{{StorefrontProductActionSection.quantity}}" stepKey="scrollToQuantityField"/> |
| 46 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> |
| 47 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 48 | + <argument name="productQty" value="2"/> |
| 49 | + </actionGroup> |
| 50 | + <!-- Go to Checkout Page --> |
| 51 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 52 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping"/> |
| 53 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> |
| 54 | + <!-- Click on PayPal payment radio button --> |
| 55 | + <waitForElementClickable selector="{{AdminConfigurepaymentsAdvancedSection.payflowEdition}}" stepKey="waitForPayPalRadioButton"/> |
| 56 | + <click selector="{{AdminConfigurepaymentsAdvancedSection.payflowEdition}}" stepKey="selectPaypalPayment"/> |
| 57 | + <waitForElementClickable selector="{{CheckoutPaymentSection.ContinuePayPalBtn}}" stepKey="waitForPayPalBtn"/> |
| 58 | + <click selector="{{CheckoutPaymentSection.ContinuePayPalBtn}}" stepKey="clickPayPalBtn"/> |
| 59 | + <actionGroup ref="StorefrontLoginToPayPalExpressCheckoutPayFlowEditionActionGroup" stepKey="loginToPayPal"/> |
| 60 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 61 | + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> |
| 62 | + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> |
| 63 | + </before> |
| 64 | + <after> |
| 65 | + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> |
| 66 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 67 | + <magentoCLI command="config:set {{DisablePaymentAdvancedSolution.path}} {{DisablePaymentAdvancedSolution.value}}" stepKey="setEnablePayflowAdvancedToNo"/> |
| 68 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 69 | + </after> |
| 70 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/> |
| 71 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty"> |
| 72 | + <actualResult type="const">$orderNumber</actualResult> |
| 73 | + </assertNotEmpty> |
| 74 | + <!--Go to admin sales page and open the order id--> |
| 75 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 76 | + <argument name="orderId" value="{$orderNumber}"/> |
| 77 | + </actionGroup> |
| 78 | + <!--Submit invoice--> |
| 79 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/> |
| 80 | + <seeOptionIsSelected userInput="Capture Online" selector="{{AdminInvoiceTotalSection.amount}}" stepKey="seeOptionType"/> |
| 81 | + <!--Update qty as 1 and assert the status of the order--> |
| 82 | + <actionGroup ref="AdminFillQtyToInvoiceOnCreateInvoicePageActionGroup" stepKey="fillInvoiceQuantity"> |
| 83 | + <argument name="qty" value="1"/> |
| 84 | + </actionGroup> |
| 85 | + <actionGroup ref="AdminClickUpdateQtysButtonOnCreateInvoicePageActionGroup" stepKey="clickUpdateQtyAfterUpdatingInvoiceBtn"/> |
| 86 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> |
| 87 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus"> |
| 88 | + <argument name="status" value="Processing"/> |
| 89 | + </actionGroup> |
| 90 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 91 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 92 | + <!--Open the comment history tab and assert the comment--> |
| 93 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistoryAfterSubmittingInvoice"/> |
| 94 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $135.15 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotesAfterSubmittingInvoice"/> |
| 95 | + <!-- Check the last transaction of the order and validate the details for Captured and Authorization--> |
| 96 | + <actionGroup ref="AdminViewAuthorizationTransactionsInOrderActionGroup" stepKey="validateAuthTransaction"/> |
| 97 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="No" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> |
| 98 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 99 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 100 | + <actionGroup ref="AdminAssertTransitionTypeStatusNewActionGroup" stepKey="assertTransactionTypeStatusForCapture"> |
| 101 | + <argument name="transactionType" value="capture"/> |
| 102 | + <argument name="transitionTypeStatus" value="No"/> |
| 103 | + </actionGroup> |
| 104 | + </test> |
| 105 | +</tests> |
| 106 | + |
0 commit comments