Skip to content

Commit d2bd1d4

Browse files
committed
Merge branch '2.4-develop' of https://github.com/mage-os/mirror-magento2 into 2.4-develop
2 parents 029bfed + 5d6df08 commit d2bd1d4

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/AdminProductAttributeMessageData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="ProductAttributeMessages">
1212
<data key="remove_success">You deleted the product attribute.</data>
13+
<data key="special_price_date_validation_error">Make sure the To Date is later than or the same as the From Date</data>
1314
</entity>
1415
</entities>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2026 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminMassUpdateProductSpecialPriceDateValidationTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Mass update product attributes"/>
14+
<title value="Mass update product special price with invalid date range should display validation error"/>
15+
<description value="Validates special price date range during mass product attribute update"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-15367"/>
18+
<group value="catalog"/>
19+
<group value="product_attributes"/>
20+
</annotations>
21+
<before>
22+
<!-- Step 1: Login to magento admin panel. -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Create test data: category and SIMPLE products -->
25+
<createData entity="_defaultCategory" stepKey="createCategory"/>
26+
<createData entity="ApiSimpleProduct" stepKey="createProductOne">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<createData entity="ApiSimpleProduct" stepKey="createProductTwo">
30+
<requiredEntity createDataKey="createCategory"/>
31+
</createData>
32+
</before>
33+
<after>
34+
<!-- Cleanup: Delete created products and category -->
35+
<helper class="Magento\Catalog\Test\Mftf\Helper\ProductApiHelper" method="deleteAllProductsApi" stepKey="deleteAllProductsViaApi"/>
36+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
37+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
38+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
39+
</after>
40+
<!-- Step 2: Navigate to Catalog > Products to open the product grid -->
41+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
42+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGrid"/>
43+
<!-- Step 3: Select one or more products using the checkbox. -->
44+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectFirstProduct">
45+
<argument name="product" value="$createProductOne$"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectSecondProduct">
48+
<argument name="product" value="$createProductTwo$"/>
49+
</actionGroup>
50+
<!-- Step 4: From the Actions dropdown, choose Update Attributes -->
51+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickMassUpdateAttributes"/>
52+
<!-- Step 5: Enable special price date fields and set invalid dates -->
53+
<checkOption selector="{{AdminUpdateAttributesSection.toggleSpecialFromDate}}" stepKey="enableSpecialFromDateToggle"/>
54+
<checkOption selector="{{AdminUpdateAttributesSection.toggleSpecialToDate}}" stepKey="enableSpecialToDateToggle"/>
55+
<checkOption selector="{{AdminUpdateAttributesSection.toggleSpecialPrice}}" stepKey="enableSpecialPriceToggle"/>
56+
<waitForElementVisible selector="{{AdminEditProductAttributesSection.attributeInput('special_from_date')}}" stepKey="waitForFromDateField"/>
57+
<!-- Set Special Price From Date to a date AFTER Special Price To Date (Invalid) -->
58+
<fillField selector="{{AdminEditProductAttributesSection.attributeInput('special_from_date')}}" userInput="12/31/2026" stepKey="fillSpecialPriceFromDateWithInvalidFutureDate"/>
59+
<fillField selector="{{AdminEditProductAttributesSection.attributeInput('special_to_date')}}" userInput="01/01/2026" stepKey="fillToDate"/>
60+
<fillField selector="{{AdminEditProductAttributesSection.attributeInput('special_price')}}" userInput="5.00" stepKey="fillSpecialPrice"/>
61+
<!-- Click Save button -->
62+
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSaveButton"/>
63+
<waitForPageLoad stepKey="waitForSaveAction"/>
64+
<!-- Step 6: Verify error message -->
65+
<waitForText selector="{{AdminMessagesSection.errorMessage}}" userInput="{{ProductAttributeMessages.special_price_date_validation_error}}" stepKey="seeValidationErrorMessage"/>
66+
</test>
67+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2026 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminExpandConfigurableProductConfigurationsSectionActionGroup">
11+
<annotations>
12+
<description>Scrolls to and expands the Configurations section on the admin product edit page</description>
13+
</annotations>
14+
<scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToConfigurationsSection"/>
15+
<conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.currentVariations}}" visible="false" stepKey="expandConfigurationsSection"/>
16+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.currentVariations}}" stepKey="waitForVariationsVisible"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2026 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontOpenHomePageWithStoreCodeInUrlActionGroup">
11+
<annotations>
12+
<description>Goes to the Storefront Home page using Store code in URL option.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="storeCode" type="string" defaultValue="{{customStore.code}}"/>
16+
</arguments>
17+
<amOnPage url="{{StorefrontStoreHomePage.url(storeCode)}}" stepKey="goToStorefrontHomePage"/>
18+
<waitForPageLoad stepKey="waitForStorefrontHomePageLoad"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)