Skip to content

Commit 520a820

Browse files
author
Mohan Ahuja
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into ACP2E-841
2 parents 6b3a159 + 09c80c7 commit 520a820

File tree

127 files changed

+3352
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3352
-480
lines changed
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 © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
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="AdminPasswordResetSettingsTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="[SPM-2] Password Reset settings (for Admin)"/>
15+
<title value="[SPM-2] Password Reset settings (for Admin)"/>
16+
<description value="Password Reset settings for Admin"/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="MC-27441"/>
19+
<group value="Admin_UI"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
24+
</before>
25+
26+
<after>
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
28+
</after>
29+
30+
<!-- Goto Configurable>Advance>Admin and expand security Tab -->
31+
<amOnPage url="{{AdminConfigAdvancedAdmin.url}}" stepKey="navigateToConfigurationPage"/>
32+
<waitForPageLoad stepKey="wait1"/>
33+
<conditionalClick stepKey="expandSecurityTab" selector="{{AdminSection.SecurityTab}}" dependentSelector="{{AdminSection.CheckIfTabExpand}}" visible="true"/>
34+
35+
<!-- Uncheck system value and enter the number for password reset limitation -->
36+
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
37+
<argument name="rowId" value="row_admin_security_max_number_password_reset_requests"/>
38+
</actionGroup>
39+
<waitForPageLoad stepKey="waitForPageLoad"/>
40+
<fillField selector="{{AdminSection.passwordLimitation}}" userInput="1" stepKey="fillNumbersForPasswordLimitation"/>
41+
<waitForPageLoad stepKey="waitForPageLoad1"/>
42+
43+
<!-- check system value after entering the password reset limitation and save the configuration-->
44+
<actionGroup ref="AdminCheckUseSystemValueActionGroup" stepKey="checkUseSystemValue">
45+
<argument name="rowId" value="row_admin_security_max_number_password_reset_requests"/>
46+
</actionGroup>
47+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
48+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveCookieLifetimeSuccessMessage">
49+
<argument name="message" value="You saved the configuration."/>
50+
<argument name="messageType" value="success"/>
51+
</actionGroup>
52+
53+
<!--Collabase Security Tab and log out -->
54+
<click selector="{{AdminSection.SecurityTab}}" stepKey="minimiseSecurityTab"/>
55+
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
57+
58+
<!-- login with wrong password and verify the error message first time1-->
59+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
60+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="admin" stepKey="fillUsername"/>
61+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="Admin@1234" stepKey="fillPassword"/>
62+
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
63+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="verifyErrorMessage"/>
64+
65+
<!-- login with wrong password and verify the error message first time2-->
66+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin1"/>
67+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="admin" stepKey="fillUsername1"/>
68+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="Admin@1" stepKey="fillPassword1"/>
69+
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin1"/>
70+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="verifyErrorMessage1"/>
71+
72+
<!-- login with valid credentials-->
73+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin1"/>
74+
75+
</test>
76+
</tests>

app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductPriceValidationErrorDisappearedAfterSwitchToDynamicPriceTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<argument name="price" value="test"/>
3535
</actionGroup>
3636
<actionGroup ref="AssertAdminValidationErrorAppearedForPriceFieldOnProductEditPageActionGroup" stepKey="assertVisibleError">
37-
<argument name="errorMessage" value="Please enter a number 0 or greater in this field."/>
37+
<argument name="errorMessage" value="Please enter a number 0 or greater, without comma in this field."/>
3838
</actionGroup>
3939
<actionGroup ref="AdminToggleSwitchDynamicPriceOnProductEditPageActionGroup" stepKey="enableDynamicPrice"/>
4040
<actionGroup ref="AssertAdminNoValidationErrorForPriceFieldOnProductEditPageActionGroup" stepKey="assertNotVisibleError"/>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ class Helper
121121
*/
122122
private $categoryLinkFactory;
123123

124+
/**
125+
* @var array
126+
*/
127+
private $productDataKeys = [
128+
'weight',
129+
'special_price',
130+
'cost',
131+
'country_of_manufacture',
132+
'description',
133+
'short_description',
134+
'meta_description',
135+
'meta_keyword',
136+
'meta_title',
137+
'page_layout',
138+
'custom_design',
139+
'gift_wrapping_price'
140+
];
141+
124142
/**
125143
* Constructor
126144
*
@@ -203,6 +221,12 @@ public function initializeFromData(Product $product, array $productData)
203221
$productData['product_has_weight'] = 0;
204222
}
205223

224+
foreach ($productData as $key => $value) {
225+
if (in_array($key, $this->productDataKeys) && $value === '') {
226+
$productData[$key] = null;
227+
}
228+
}
229+
206230
foreach (['category_ids', 'website_ids'] as $field) {
207231
if (!isset($productData[$field])) {
208232
$productData[$field] = [];

app/code/Magento/Catalog/Model/Indexer/Product/Eav/AbstractAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class AbstractAction
1717
/**
1818
* Config path for enable EAV indexer
1919
*/
20-
const ENABLE_EAV_INDEXER = 'catalog/search/enable_eav_indexer';
20+
public const ENABLE_EAV_INDEXER = 'catalog/search/enable_eav_indexer';
2121

2222
/**
2323
* EAV Indexers by type
@@ -142,7 +142,7 @@ protected function syncData($indexer, $destinationTable, $ids)
142142
$connection->beginTransaction();
143143
try {
144144
// remove old index
145-
$where = $connection->quoteInto('entity_id IN(?)', $ids);
145+
$where = $connection->quoteInto('entity_id IN (?)', $ids, 'INT');
146146
$connection->delete($destinationTable, $where);
147147
// insert new index
148148
$indexer->insertFromTable($indexer->getIdxTable(), $destinationTable);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@
829829
<entity name="virtualProductCustomImportOptions" type="product">
830830
<data key="name" unique="suffix">VirtualProduct</data>
831831
<data key="sku" unique="suffix">virtual_sku</data>
832-
<data key="price">9,000.00</data>
832+
<data key="price">9000.00</data>
833+
<data key="formattedPrice">9,000.00</data>
833834
<data key="quantity">999</data>
834835
<data key="status">In Stock</data>
835836
<data key="visibility">Catalog, Search</data>
@@ -850,7 +851,8 @@
850851
<entity name="virtualProductOutOfStock" type="product">
851852
<data key="name" unique="suffix">VirtualProduct</data>
852853
<data key="sku" unique="suffix">virtual_sku</data>
853-
<data key="price">9,000.00</data>
854+
<data key="price">9000.00</data>
855+
<data key="formattedPrice">9,000.00</data>
854856
<data key="quantity">999</data>
855857
<data key="status">Out of Stock</data>
856858
<data key="visibility">Catalog, Search</data>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<entity name="tierPriceHighCostSimpleProduct" type="data">
4646
<data key="website">All Websites [USD]</data>
4747
<data key="customer_group">ALL GROUPS</data>
48-
<data key="price">500,000.00</data>
48+
<data key="price">500000.00</data>
4949
<data key="qty">1</data>
5050
</entity>
5151
<entity name="tierProductPrice" type="catalogTierPrice">

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryBasicFieldSection/AdminCategoryBasicFieldSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<element name="productsInCategory" type="input" selector="div[data-index='assign_products']" timeout="30"/>
2525
<element name="scheduleDesignUpdateTab" type="block" selector="div[data-index='schedule_design_update']" timeout="15"/>
2626
<element name="categoryNameRequiredField" type="text" selector="//label[@class='admin__field-error' and contains(text(),'This is a required field.')]" timeout="15"/>
27+
<element name="urlExistsErrorMessage" type="text" selector="//div[@class='message message-error error']//h4[contains(text(),'The value specified in the URL Key field would generate a URL that already exists.')]" timeout="30"/>
2728
</section>
2829
</sections>
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
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="AdminCreateCategoriesWithTheSameCategoryNamesTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create categories with the same category names"/>
15+
<title value="Create categories with the same category names"/>
16+
<description value="Verify that it's possible to create categories with the same URL keys, but only if they will have different URL paths"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-27423"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
</before>
25+
26+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="amOnAdminCategoryPage"/>
27+
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
28+
<waitForPageLoad stepKey="waitForPageLoad1"/>
29+
<!--Create subcategory-->
30+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory1">
31+
<argument name="categoryEntity" value="SubCategory"/>
32+
</actionGroup>
33+
34+
<!--Open the root category and add subcategory with same name. Save category.-->
35+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="amOnAdminCategoryPage1"/>
36+
<waitForPageLoad stepKey="waitForPageLoad2"/>
37+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
38+
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableNewCategory"/>
39+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SubCategory.name}}" stepKey="fillSameSubCategoryName"/>
40+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSameSubCategoryFirstTime"/>
41+
<seeElement selector="{{AdminCategoryBasicFieldSection.urlExistsErrorMessage}}" stepKey="validateErrorMessages"/>
42+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSameSubCategoryAgain"/>
43+
<seeElement selector="{{AdminCategoryBasicFieldSection.urlExistsErrorMessage}}" stepKey="validateSameErrorMessages"/>
44+
45+
<!--Create category1/NewCategory-->
46+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="amOnAdminCategoryPage2"/>
47+
<waitForPageLoad stepKey="waitForPageLoadAgain"/>
48+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton1"/>
49+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createNewSubcategory1">
50+
<argument name="categoryEntity" value="FirstLevelSubCat"/>
51+
</actionGroup>
52+
<click selector="{{FirstLevelSubCat.name}}" stepKey="clickOnCreateCategory1"/>
53+
<waitForPageLoad stepKey="waitForCategory1PageLoad"/>
54+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory1Button"/>
55+
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory1"/>
56+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SubCategory.name}}" stepKey="fillFirstSubCategoryName"/>
57+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFirstSubCategory"/>
58+
59+
<!-- Verify success message -->
60+
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage"/>
61+
62+
<!--Create category2/NewCategory-->
63+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="amOnAdminCategoryPage3"/>
64+
<waitForPageLoad stepKey="waitForCategory2PageLoad"/>
65+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton2"/>
66+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createNewSubcategory2">
67+
<argument name="categoryEntity" value="SecondLevelSubCat"/>
68+
</actionGroup>
69+
<click selector="{{SecondLevelSubCat.name}}" stepKey="clickOnCreateCategory2"/>
70+
<waitForPageLoad stepKey="waitForPageLoad3"/>
71+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory2Button"/>
72+
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory2"/>
73+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SubCategory.name}}" stepKey="fillSecondSubCategoryName"/>
74+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSecondSubCategory"/>
75+
76+
<!-- Verify success message -->
77+
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage1"/>
78+
79+
<!--Go to store front page-->
80+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomepage"/>
81+
82+
<!-- Check on storefront that category was created, Its URL path is '.../new.html' -->
83+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryStorefrontPage1">
84+
<argument name="categoryUrl" value="{{SubCategory.urlKey}}"/>
85+
</actionGroup>
86+
<see userInput="{{SubCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryNewHtmlOnStorefront"/>
87+
88+
<!-- Check on storefront that category was created, Its URL path is '.../cat1/new.html'-->
89+
<amOnPage url="/{{FirstLevelSubCat.name}}/{{SubCategory.name}}.html" stepKey="goToConfigProductPage1"/>
90+
<seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryCat1NewHtmlOnStorefront"/>
91+
92+
<!--Check on storefront that category was created, Its URL path is '.../cat2/new.html'-->
93+
<amOnPage url="/{{SecondLevelSubCat.name}}/{{SubCategory.name}}.html" stepKey="goToConfigProductPage2"/>
94+
<seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryCat2NewHtmlOnStorefront"/>
95+
96+
<after>
97+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage1"/>
98+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SecondLevelSubCat.name)}}" stepKey="clickCategoryLink"/>
99+
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/>
100+
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/>
101+
<see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/>
102+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/>
103+
<waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/>
104+
<see selector="You deleted the category." stepKey="seeDeleteSuccess"/>
105+
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandToSeeAllCategories"/>
106+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(SecondLevelSubCat.name)}}" stepKey="dontSeeCategoryInTree"/>
107+
108+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(FirstLevelSubCat.name)}}" stepKey="clickCategoryLink1"/>
109+
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete1"/>
110+
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal1"/>
111+
<see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage1"/>
112+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete1"/>
113+
<waitForPageLoad time="60" stepKey="waitForDeleteToFinish1"/>
114+
<see selector="You deleted the category." stepKey="seeDeleteSuccess1"/>
115+
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandToSeeAllCategories1"/>
116+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(FirstLevelSubCat.name)}}" stepKey="dontSeeCategoryInTree1"/>
117+
118+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SubCategory.name)}}" stepKey="clickCategoryLink2"/>
119+
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete2"/>
120+
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal2"/>
121+
<see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage2"/>
122+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete2"/>
123+
<waitForPageLoad time="60" stepKey="waitForDeleteToFinish2"/>
124+
<see selector="You deleted the category." stepKey="seeDeleteSuccess2"/>
125+
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandToSeeAllCategories2"/>
126+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(SubCategory.name)}}" stepKey="dontSeeCategoryInTree2"/>
127+
128+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
129+
</after>
130+
131+
</test>
132+
</tests>
133+

0 commit comments

Comments
 (0)