|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminVoidSalesOrderPlacedWithPayPalStandardTest"> |
| 12 | + <annotations> |
| 13 | + <features value="PayPal"/> |
| 14 | + <stories value="PayPal Standard"/> |
| 15 | + <title value="Void a Sales Order placed with PayPal Standard"/> |
| 16 | + <description value="Place an order with PayPal Standard payment method and void the order from admin. Validate order status, transaction details, and comments history."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-5375"/> |
| 19 | + <group value="paypalStandard"/> |
| 20 | + <group value="3rd_party_integration"/> |
| 21 | + <group value="pr_exclude"/> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <!-- Login to admin --> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + <!-- Create simple product --> |
| 27 | + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"> |
| 28 | + <field key="price">10</field> |
| 29 | + </createData> |
| 30 | + <!-- Create US customer --> |
| 31 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <!-- Customer logout --> |
| 35 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 36 | + <!-- Clean up created data --> |
| 37 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 38 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 39 | + <!-- Admin logout --> |
| 40 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 41 | + </after> |
| 42 | + <!-- Step 1: Navigate to StoreFront --> |
| 43 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 44 | + <!-- Login as customer --> |
| 45 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> |
| 46 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 47 | + </actionGroup> |
| 48 | + <!-- Add product to cart --> |
| 49 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 50 | + <argument name="product" value="$$createProduct$$"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Proceed to checkout --> |
| 53 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 54 | + <!-- Proceed to payment step --> |
| 55 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> |
| 56 | + <!-- Select PayPal Standard payment method --> |
| 57 | + <actionGroup ref="AdminSelectPaypalStandardPaymentInPaymentPageActionGroup" stepKey="selectPaypalStandardPaymentAndClickOnContinueButton"/> |
| 58 | + <!-- Login to PayPal and complete payment --> |
| 59 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 60 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 61 | + <!-- Wait for order success page and grab order number --> |
| 62 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 63 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 64 | + <!-- Step 2: Go to Sales > Orders (Admin) --> |
| 65 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 66 | + <!-- Filter orders by the created order ID --> |
| 67 | + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid"> |
| 68 | + <argument name="orderId" value="$grabOrderNumber"/> |
| 69 | + </actionGroup> |
| 70 | + <!-- Step 3: Open the Order from preconditions --> |
| 71 | + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> |
| 72 | + <!-- Verify order details and totals --> |
| 73 | + <actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkOrderTotals"> |
| 74 | + <argument name="subtotal" value="$10.00"/> |
| 75 | + <argument name="shippingAndHandling" value="$5.00"/> |
| 76 | + <argument name="grandTotal" value="$15.00"/> |
| 77 | + </actionGroup> |
| 78 | + <!-- Verify initial order status is Processing --> |
| 79 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkInitialOrderStatus"> |
| 80 | + <argument name="status" value="Processing"/> |
| 81 | + </actionGroup> |
| 82 | + <!-- Step 4: Click Void button --> |
| 83 | + <!-- Step 5: Click OK button and verify success message --> |
| 84 | + <actionGroup ref="AdminVoidPendingOrderActionGroup" stepKey="voidPendingOrder"/> |
| 85 | + <!-- Step 6: Observe order data --> |
| 86 | + <!-- Verify order status remains Processing --> |
| 87 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatusAfterVoid"> |
| 88 | + <argument name="status" value="Processing"/> |
| 89 | + </actionGroup> |
| 90 | + <!-- Grab transaction ID for validation --> |
| 91 | + <waitForElementVisible selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForGrabLastTransactionID"/> |
| 92 | + <grabTextFrom selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/> |
| 93 | + <!-- Verify void authorization message in comments history --> |
| 94 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 95 | + <!-- Verify void authorization message with amount and transaction ID in comments --> |
| 96 | + <waitForText selector="{{AdminOrderCommentsTabSection.authorizationNotes('Voided authorization')}}" userInput="{{BillingAgreement.amount_note}} Transaction ID: "$grabLastTransactionID"" stepKey="seeVoidAuthorizationMessageWithAmount"/> |
| 97 | + <!-- Verify transactions tab shows both authorization and void transactions --> |
| 98 | + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasAuthorization"> |
| 99 | + <argument name="transactionType" value="authorization"/> |
| 100 | + </actionGroup> |
| 101 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> |
| 102 | + <!-- Navigate back to order details --> |
| 103 | + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> |
| 104 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> |
| 105 | + <!-- Verify void transaction --> |
| 106 | + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasVoid"> |
| 107 | + <argument name="transactionType" value="void"/> |
| 108 | + </actionGroup> |
| 109 | + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/> |
| 110 | + </test> |
| 111 | +</tests> |
0 commit comments