|
| 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="AdminOrderEditParentChildOrderLinksTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <title value="Verify parent-child order links are displayed when editing and submitting an order"/> |
| 15 | + <stories value="Order parent-child link verification"/> |
| 16 | + <description value="Verify parent-child order links are shown after editing and submitting an order."/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + <testCaseId value="AC-8706"/> |
| 19 | + <group value="Sales"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Enable payment method one of "check/money order" and shipping method one of "flat rate" --> |
| 23 | + <actionGroup ref="CliEnableFlatRateShippingMethodActionGroup" stepKey="enableFlatRateShipping"/> |
| 24 | + <actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/> |
| 25 | + <!-- Create product and customer --> |
| 26 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 28 | + <!-- Login to Admin page --> |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 30 | + <!-- Create order in admin --> |
| 31 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> |
| 32 | + <argument name="product" value="$$createProduct$$"/> |
| 33 | + <argument name="customer" value="$$createCustomer$$"/> |
| 34 | + </actionGroup> |
| 35 | + </before> |
| 36 | + <after> |
| 37 | + <!-- Clean up test data --> |
| 38 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 39 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 40 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 41 | + <!-- Disable shipping method "Flat Rate" --> |
| 42 | + <magentoCLI command="config:set carriers/flatrate/active 0" stepKey="disableFlatRate"/> |
| 43 | + <!-- Disable payment method "Check/Money Order" --> |
| 44 | + <magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} 0" stepKey="disableCheckMoneyOrder"/> |
| 45 | + </after> |
| 46 | + <!-- Grab original order ID --> |
| 47 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOriginalOrderId"/> |
| 48 | + <!-- Step 1: Go to sales >> order and open the original order --> |
| 49 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOriginalOrderInAdmin"> |
| 50 | + <argument name="orderId" value="{$grabOriginalOrderId}"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Step 2: Edit the order --> |
| 53 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="waitForClickEditOrderButton"/> |
| 54 | + <click selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="clickEditOrderButton"/> |
| 55 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.ok}}" time="30" stepKey="waitForEditOrderConfirmation"/> |
| 56 | + <click selector="{{AdminOrderDetailsMainActionsSection.ok}}" stepKey="confirmEditOrder"/> |
| 57 | + <!-- Step 3: Submit edited order --> |
| 58 | + <waitForElementClickable selector="{{OrdersGridSection.submitOrder}}" stepKey="waitForSubmitEditedOrder"/> |
| 59 | + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitEditedOrder"/> |
| 60 | + <!-- Step 4: Verify the link is displayed on child order view to parent order --> |
| 61 | + <grabTextFrom selector="{{AdminOrderDetailsMainActionsSection.linkToPreviousOrder}}" stepKey="grabLinkToPreviousOrderText"/> |
| 62 | + <assertEquals stepKey="assertPreviousOrderLinkText"> |
| 63 | + <expectedResult type="string">{{OrderLinks.linkToPreviousOrder}}</expectedResult> |
| 64 | + <actualResult type="variable">grabLinkToPreviousOrderText</actualResult> |
| 65 | + </assertEquals> |
| 66 | + <!-- Step 5: Verify the link is displayed on parent order view to new order --> |
| 67 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOriginalOrderInAdminAgain"> |
| 68 | + <argument name="orderId" value="{$grabOriginalOrderId}"/> |
| 69 | + </actionGroup> |
| 70 | + <grabTextFrom selector="{{AdminOrderDetailsMainActionsSection.linkToNewOrder}}" stepKey="grabLinkToNewOrderText"/> |
| 71 | + <assertEquals stepKey="assertNewOrderLinkText"> |
| 72 | + <expectedResult type="string">{{OrderLinks.linkToNewOrder}}</expectedResult> |
| 73 | + <actualResult type="variable">grabLinkToNewOrderText</actualResult> |
| 74 | + </assertEquals> |
| 75 | + </test> |
| 76 | +</tests> |
0 commit comments