Skip to content

Commit 2452012

Browse files
Merge branch 'ACQE-8470' into ACQE-functional-deployment-v3-3
2 parents 61b0562 + 44c77fc commit 2452012

File tree

3 files changed

+85
-3
lines changed

3 files changed

+85
-3
lines changed

app/code/Magento/Sales/Test/Mftf/Data/ConstData.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2018 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -13,4 +13,8 @@
1313
<data key="two">2</data>
1414
<data key="fifty">50</data>
1515
</entity>
16+
<entity name="OrderLinks" type="constant">
17+
<data key="linkToNewOrder">Link to the New Order</data>
18+
<data key="linkToPreviousOrder">Link to the Previous Order</data>
19+
</entity>
1620
</entities>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2017 Adobe
55
* All Rights Reserved.
66
*/
77
-->
@@ -31,5 +31,7 @@
3131
<element name="void" type="button" selector="#void_payment span"/>
3232
<element name="invoiceTabContent1" type="text" selector="#sales_order_view_tabs_order_invoices_content > div > div.admin__data-grid-wrap > table > tbody > tr > td"/>
3333
<element name="creditMemoWarning" type="text" selector="//div[@class='modal-content']//div[text()='This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?']"/>
34+
<element name="linkToNewOrder" type="text" selector="//*[@id='sales_order_view_tabs_order_info_content']/section[1]/div[2]/div[1]/div[2]/table/tbody/tr[4]/th"/>
35+
<element name="linkToPreviousOrder" type="text" selector="//*[@id='sales_order_view_tabs_order_info_content']/section[1]/div[2]/div[1]/div[2]/table/tbody/tr[4]/th"/>
3436
</section>
3537
</sections>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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

Comments
 (0)