Skip to content

Commit 6234dcb

Browse files
Merge remote-tracking branch 'origin/MC-31892' into 2.4-develop-pr33
2 parents 9f44ea8 + e08f991 commit 6234dcb

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="shortDescriptionTextArea" type="textarea" selector="#product_form_short_description"/>
1616
<element name="sectionHeaderIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/>
1717
<element name="pageHeader" type="textarea" selector="//*[@class='page-header row']"/>
18+
<element name="attributeInput" type="input" selector="input[name='product[{{attributeCode}}]']" parameterized="true"/>
1819
</section>
1920
</sections>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminChangeProductAttributeGroupTest">
11+
<annotations>
12+
<title value="Preserving attribute value after attribute group is changed"/>
13+
<description value="Attribute value should be preserved after changing attribute group"/>
14+
<severity value="CRITICAL"/>
15+
<testCaseId value="MC-35612"/>
16+
<useCaseId value="MC-31892"/>
17+
<group value="catalog"/>
18+
</annotations>
19+
<before>
20+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
21+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
22+
<requiredEntity createDataKey="createCategory"/>
23+
</createData>
24+
25+
<createData entity="productAttributeText" stepKey="createProductAttribute"/>
26+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
27+
<createData entity="CatalogAttributeSet" stepKey="createSecondAttributeSet"/>
28+
29+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
30+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/"
31+
stepKey="onAttributeSetEdit"/>
32+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
33+
<argument name="group" value="Product Details"/>
34+
<argument name="attribute" value="$createProductAttribute.attribute_code$"/>
35+
</actionGroup>
36+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
37+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createSecondAttributeSet.attribute_set_id$/"
38+
stepKey="onSecondAttributeSetEdit"/>
39+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToContentGroup">
40+
<argument name="group" value="Content"/>
41+
<argument name="attribute" value="$createProductAttribute.attribute_code$"/>
42+
</actionGroup>
43+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveSecondAttributeSet"/>
44+
</before>
45+
<after>
46+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
47+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
48+
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
49+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
50+
<deleteData createDataKey="createSecondAttributeSet" stepKey="deleteSecondAttributeSet"/>
51+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
52+
53+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
54+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
55+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
56+
</after>
57+
58+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
59+
<argument name="product" value="$createSimpleProduct$"/>
60+
</actionGroup>
61+
62+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1">
63+
<argument name="product" value="$createSimpleProduct$"/>
64+
</actionGroup>
65+
66+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet">
67+
<argument name="attributeSetName" value="$createAttributeSet.attribute_set_name$"/>
68+
</actionGroup>
69+
<waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInForm"/>
70+
<fillField selector="{{AdminProductFormSection.attributeRequiredInput($createProductAttribute.attribute_code$)}}"
71+
userInput="test"
72+
stepKey="fillProductAttributeValue"/>
73+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectSecondAttributeSet">
74+
<argument name="attributeSetName" value="$createSecondAttributeSet.attribute_set_name$"/>
75+
</actionGroup>
76+
<actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandContentSection"/>
77+
<waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInSection"/>
78+
<grabValueFrom selector="{{AdminProductContentSection.attributeInput($createProductAttribute.attribute_code$)}}"
79+
stepKey="attributeValue"/>
80+
<assertEquals stepKey="assertAttributeValue">
81+
<expectedResult type="string">test</expectedResult>
82+
<actualResult type="variable">attributeValue</actualResult>
83+
</assertEquals>
84+
</test>
85+
</tests>

app/code/Magento/Ui/view/base/web/js/core/renderer/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ define([
499499
component = registry.get(val.path);
500500

501501
if (component) {
502-
component.cleanData().destroy();
502+
component.destroy();
503503
}
504504
});
505505

0 commit comments

Comments
 (0)