|
| 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