Skip to content

Commit fdfb025

Browse files
Merge branch '2.4-develop' into spartans_pr_17102025_AC-15856
2 parents 40751fd + 2433855 commit fdfb025

File tree

7 files changed

+191
-2
lines changed

7 files changed

+191
-2
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@
1818
</arguments>
1919
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartDisabled}}" stepKey="waitForAddToCartButtonToRemoveDisabledState"/>
2020
<!-- Scroll to button to prevent overlapping elements from intercepting click -->
21-
<scrollToTopOfPage stepKey="scrollToAddToCartButton"/>
21+
<scrollTo selector="{{StorefrontProductActionSection.addToCart}}" stepKey="scrollToAddToCartButton"/>
22+
<wait time="1" stepKey="waitForScrollToComplete"/>
23+
<!-- Additional scroll with JS to ensure element is in viewport and not intercepted -->
24+
<executeJS function="
25+
var element = document.querySelector('#product-addtocart-button');
26+
if (element) {
27+
element.scrollIntoView({behavior: 'smooth', block: 'center'});
28+
}
29+
" stepKey="scrollToAddToCartButtonWithJS"/>
2230
<waitForElementClickable selector="{{StorefrontProductActionSection.addToCart}}" stepKey="waitForAddToCartButton"/>
2331
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
2432
<waitForPageLoad stepKey="waitForAddToCart"/>

app/code/Magento/Paypal/Test/Mftf/Section/PayPalExpressCheckoutConfigSection/PayPalPaymentSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
<element name="changeShippingAddressButton" type="button" selector="//button[@data-dd-action-name='Ship to Tab']"/>
3838
<element name="shippingAddressDropdown" type="select" selector="(//div[@data-dd-action-name='Shipping Address'][.//span[contains(normalize-space(.), '{{ShippingAddress}}')]])[1]" parameterized="true"/>
3939
<element name="selectedShippingAddress" type="text" selector="//div/p[contains(text(), '{{selectedAddress}}')]" parameterized="true"/>
40-
<element name="usePasswordInsteadButton" type="button" selector="(//button[text()='Use Password Instead'] | //a[text()='Try another way'])[1]"/>
40+
<element name="usePasswordInsteadButton" type="button" selector="(//button[text()='Use Password Instead'] | //*[@normalize-space(text())='Try another way'])[1]"/>
4141
</section>
4242
</sections>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@
4848
<entity name="AdminPaymentErrorMessage" type="message">
4949
<data key="error_Message">This payment method is not available.</data>
5050
</entity>
51+
<entity name="AdminOrderEmailsSendMessage" type="text">
52+
<data key="emailSuccessMessage">You sent the message.</data>
53+
<data key="shipmentEmailSuccessMessage">You sent the shipment.</data>
54+
</entity>
5155
</entities>

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>

app/code/Magento/Shipping/Test/Mftf/Data/USPSShippingMethodData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,7 @@
107107
<entity name="ShippingTypeUSPSConfigData" type="usps_config">
108108
<data key="value">Priority Mail International Flat Rate Envelope</data>
109109
</entity>
110+
<entity name="USPSFirstClassInternationalShippingMethodData" type="usps_config">
111+
<data key="value">First-Class Package International Service</data>
112+
</entity>
110113
</entities>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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="StorefrontVerifyUSPSShippingMethodIsAvailableTest">
12+
<annotations>
13+
<features value="Shipping"/>
14+
<stories value="Place order for international address other than US using USPS"/>
15+
<title value="Storefront place order with usps shipping method"/>
16+
<description value="Verify storefront able to see First-Class Package International Service usps shipping method"/>
17+
<testCaseId value="AC-14499"/>
18+
<severity value="MAJOR"/>
19+
<group value="3rd_party_integration"/>
20+
<group value="EnableUSPSShippingForRestAPISuite"/>
21+
<group value="pr_exclude"/>
22+
</annotations>
23+
<before>
24+
<!-- Create Product and customer data -->
25+
<createData entity="SimpleProduct" stepKey="createProduct"/>
26+
<createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/>
30+
<!--Delete product and customer data-->
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
33+
</after>
34+
<!-- Step 1:Navigate to storefront -->
35+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomerToStorefront">
36+
<argument name="Customer" value="$createCustomer$" />
37+
</actionGroup>
38+
<!-- Step 2:Add product to cart -->
39+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage">
40+
<argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/>
41+
</actionGroup>
42+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
43+
<argument name="product" value="$createProduct$" />
44+
<argument name="productCount" value="1" />
45+
</actionGroup>
46+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
47+
<!-- Step 3:Select International Address other than USA -->
48+
<actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress">
49+
<argument name="address" value="Canada_Address"/>
50+
</actionGroup>
51+
<!-- Step 4:Select First-Class Package International Service USPS Shipping method -->
52+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setUSPSShippingMethodOnCheckout">
53+
<argument name="shippingMethodName" value="{{USPSFirstClassInternationalShippingMethodData.value}}"/>
54+
</actionGroup>
55+
<!-- Step 5:Place order -->
56+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="goToPaymentStep"/>
57+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/>
58+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/>
59+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumber"/>
60+
</test>
61+
</tests>

0 commit comments

Comments
 (0)