|
| 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="Admin can see parent-child order links when editing and submitting an order"/> |
| 15 | + <stories value="Order parent-child link display"/> |
| 16 | + <description value="Test that 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 | + <!-- Create product and customer --> |
| 23 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + <!-- Login to Admin page --> |
| 26 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 27 | + <!-- Precondition 2: Create order in admin --> |
| 28 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> |
| 29 | + <argument name="product" value="$$createProduct$$"/> |
| 30 | + <argument name="customer" value="$$createCustomer$$"/> |
| 31 | + </actionGroup> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <!-- Clean up test data --> |
| 35 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 36 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 37 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 38 | + </after> |
| 39 | + <!-- Grab original order ID --> |
| 40 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOriginalOrderId"/> |
| 41 | + <!-- Step 1: Go to sales >> order and open the original order --> |
| 42 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOriginalOrderInAdmin"> |
| 43 | + <argument name="orderId" value="{$grabOriginalOrderId}"/> |
| 44 | + </actionGroup> |
| 45 | + <!-- Step 2: Edit the order --> |
| 46 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="waitForClickEditOrderButton"/> |
| 47 | + <click selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="clickEditOrderButton"/> |
| 48 | + <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.ok}}" stepKey="waitForEditOrderConfirmation"/> |
| 49 | + <click selector="{{AdminOrderDetailsMainActionsSection.ok}}" stepKey="confirmEditOrder"/> |
| 50 | + <!-- Step 3: Submit edited order --> |
| 51 | + <waitForElementClickable selector="{{OrdersGridSection.submitOrder}}" stepKey="waitForSubmitEditedOrder"/> |
| 52 | + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitEditedOrder"/> |
| 53 | + <!-- Step 4: Verify the link is displayed on child order view to parent order --> |
| 54 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabNewOrderId"/> |
| 55 | + <waitForText userInput="$grabOriginalOrderId" selector="{{AdminOrderDetailsMainActionsSection.linkOrder(OrderLinks.linkToPreviousOrder)}}" stepKey="assertPreviousOrder"/> |
| 56 | + <!-- Step 5: Verify the link is displayed on parent order view to new order --> |
| 57 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOriginalOrderInAdminAgain"> |
| 58 | + <argument name="orderId" value="{$grabOriginalOrderId}"/> |
| 59 | + </actionGroup> |
| 60 | + <waitForText userInput="$grabNewOrderId" selector="{{AdminOrderDetailsMainActionsSection.linkOrder(OrderLinks.linkToNewOrder)}}" stepKey="assertNewOrder"/> |
| 61 | + </test> |
| 62 | +</tests> |
0 commit comments