Skip to content

Commit e981989

Browse files
ACQE-8796: Mnailine deployment PR
Resoled conflicts
2 parents b758ba9 + 698714c commit e981989

File tree

3 files changed

+121
-4
lines changed

3 files changed

+121
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2023 Adobe
5-
* All Rights Reserved.
6-
*/
3+
/**
4+
* Copyright 2018 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -45,6 +45,10 @@
4545
<data key="processing">Processing</data>
4646
<data key="ordered">Ordered</data>
4747
</entity>
48+
<entity name="AdminOrderEmailsSendMessage" type="text">
49+
<data key="emailSuccessMessage">You sent the message.</data>
50+
<data key="shipmentEmailSuccessMessage">You sent the shipment.</data>
51+
</entity>
4852
<entity name="AdminPaymentErrorMessage" type="message">
4953
<data key="error_Message">This payment method is not available.</data>
5054
</entity>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@
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?']"/>
3434
<element name="linkOrder" type="text" selector="//*[@id='sales_order_view_tabs_order_info_content']//table[contains(@class,'order-information-table')]/tbody//tr//th[text()='{{orderInfo}}']/following-sibling::td//a" parameterized="true"/>
35+
<element name="sendShipmentEmail" type="button" selector="//*[@id='save']"/>
36+
<element name="sendCreditMemoEmail" type="button" selector="//*[@id='send_notification']"/>
37+
<element name="openShipmentFromGrid" type="button" selector="table.data-grid tbody > tr:first-child a.action-menu-item[href*='order_shipment/view']"/>
38+
<element name="openCreditMemoFromGrid" type="button" selector="table.data-grid tbody > tr:first-child a.action-menu-item[href*='order_creditmemo/view']"/>
3539
</section>
3640
</sections>
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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="AdminOrderEmailsConfirmationMessageTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<title value="Admin sees confirmation messages for invoice, shipment, and credit memo emails"/>
15+
<description value="Covers storefront order placement and admin sending invoice, shipment, and credit memo emails with confirmation message checks"/>
16+
<stories value="Place order, send invoice, shipment, and credit memo emails and check confirmation messages"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-9122"/>
19+
<group value="Sales"/>
20+
</annotations>
21+
<before>
22+
<!-- Create simple product -->
23+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
24+
<!-- Create customer -->
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
</before>
27+
<after>
28+
<!-- Delete product and customer -->
29+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
30+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
31+
<!-- Logout from admin -->
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
33+
<!-- Logout from storefront -->
34+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
35+
</after>
36+
<!-- Step 1: Go to frontend and log in as customer -->
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
38+
<argument name="Customer" value="$$createCustomer$$"/>
39+
</actionGroup>
40+
<!-- Step 2: Add product to cart and place order -->
41+
<actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart">
42+
<argument name="product" value="$$createSimpleProduct$$"/>
43+
<argument name="quantity" value="1"/>
44+
</actionGroup>
45+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
46+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
47+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
48+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
49+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/>
50+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
51+
<!-- Step 3: Log in to admin -->
52+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
53+
<!-- Step 4: Go to sales order and open order -->
54+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderInAdmin">
55+
<argument name="orderId" value="{$orderNumber}"/>
56+
</actionGroup>
57+
<!-- Step 5: Create invoice, shipment, and credit memo -->
58+
<actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createInvoiceAndShipment"/>
59+
<actionGroup ref="AdminCreateCreditMemoWithReturnToStockActionGroup" stepKey="createCreditMemo"/>
60+
<!-- Step 6: In the order page, click on invoice under the information tab -->
61+
<click selector="{{AdminOrderDetailsMainActionsSection.invoiceTab}}" stepKey="goToInvoiceTab"/>
62+
<!-- Steps 7: Click on view button under action. -->
63+
<actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/>
64+
<!-- Step 8: Click on Send Email button -->
65+
<click selector="{{AdminOrderDetailsMainActionsSection.sendEmail}}" stepKey="clickSendInvoiceEmail"/>
66+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForInvoiceConfirmationModal"/>
67+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSendInvoiceEmail"/>
68+
<waitForElementVisible selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="waitForInvoiceSuccessMessage"/>
69+
<grabTextFrom selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="grabInvoiceSuccessMessage"/>
70+
<!-- Assert invoice email confirmation -->
71+
<assertEquals stepKey="assertInvoiceEmailConfirmation">
72+
<actualResult type="const">$grabInvoiceSuccessMessage</actualResult>
73+
<expectedResult type="string">{{AdminOrderEmailsSendMessage.emailSuccessMessage}}</expectedResult>
74+
</assertEquals>
75+
<!-- Step 9: Send shipment email -->
76+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderInAdmin1">
77+
<argument name="orderId" value="{$orderNumber}"/>
78+
</actionGroup>
79+
<click selector="{{AdminOrderDetailsMainActionsSection.shipmentsTab}}" stepKey="goToShipmentTab"/>
80+
<click selector="{{AdminOrderDetailsMainActionsSection.openShipmentFromGrid}}" stepKey="clickShipmentViewLink"/>
81+
<waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.sendShipmentEmail}}" stepKey="waitForSendShipmentEmailButton"/>
82+
<click selector="{{AdminOrderDetailsMainActionsSection.sendShipmentEmail}}" stepKey="clickSendShipmentEmail"/>
83+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForShipmentConfirmationModal"/>
84+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSendShipmentEmail"/>
85+
<waitForElementVisible selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="waitForShipmentSuccessMessage"/>
86+
<grabTextFrom selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="grabShipmentSuccessMessage"/>
87+
<!-- Assert shipment email confirmation -->
88+
<assertEquals stepKey="assertShipmentEmailConfirmation">
89+
<actualResult type="const">$grabShipmentSuccessMessage</actualResult>
90+
<expectedResult type="string">{{AdminOrderEmailsSendMessage.shipmentEmailSuccessMessage}}</expectedResult>
91+
</assertEquals>
92+
<!-- Step 10: Send credit memo email -->
93+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderInAdmin2">
94+
<argument name="orderId" value="{$orderNumber}"/>
95+
</actionGroup>
96+
<click selector="{{AdminCreditMemoTotalSection.creditMemoItem}}" stepKey="goToCreditMemoTab"/>
97+
<click selector="{{AdminOrderDetailsMainActionsSection.openCreditMemoFromGrid}}" stepKey="openCreditMemoFromGrid"/>
98+
<click selector="{{AdminOrderDetailsMainActionsSection.sendCreditMemoEmail}}" stepKey="clickSendCreditMemoEmail"/>
99+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForCreditMemoConfirmationModal"/>
100+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmSendCreditMemoEmail"/>
101+
<waitForElementVisible selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="waitForCreditMemoSuccessMessage"/>
102+
<grabTextFrom selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="grabCreditMemoSuccessMessage"/>
103+
<!-- Assert credit memo email confirmation -->
104+
<assertEquals stepKey="assertCreditMemoEmailConfirmation">
105+
<actualResult type="const">$grabCreditMemoSuccessMessage</actualResult>
106+
<expectedResult type="string">{{AdminOrderEmailsSendMessage.emailSuccessMessage}}</expectedResult>
107+
</assertEquals>
108+
</test>
109+
</tests>

0 commit comments

Comments
 (0)