Skip to content

Commit 25c9c2f

Browse files
committed
ACP2E-3136: [Cloud] Sub Category items are not displayed on the widgets edit on the admin backend
1 parent 40b5cd7 commit 25c9c2f

File tree

4 files changed

+159
-1
lines changed

4 files changed

+159
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group verifies that the total number of expanded categories in the admin category tree widget matches the provided expected count.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="ExpectedCount" type="string" defaultValue="1"/>
17+
</arguments>
18+
<grabMultiple selector="{{CmsNewWidgetUpdateLayoutSection.CountAllNestedCat}}" stepKey="countNestedCategory"/>
19+
<assertCount stepKey="check">
20+
<expectedResult type="int">{{ExpectedCount}}</expectedResult>
21+
<actualResult type="variable">countNestedCategory</actualResult>
22+
</assertCount>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminExpandCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group expands a specified category in the admin category tree widget by clicking on the expand icon and waiting for the page to load.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="CategoryName" type="string" defaultValue="Category 1"/>
17+
</arguments>
18+
<click selector="{{CmsNewWidgetUpdateLayoutSection.BranchCat(CategoryName)}}" stepKey="clickExpandCategory"/>
19+
<waitForPageLoad stepKey="waitForCategoryExpand"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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="AdminValidateMixedNestedCategoryInWidgetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Validate the proper loading of mixed nested categories in the category widget"/>
15+
<title value="Ensure mixed nested categories of Level 5 and beyond load correctly in the category widget"/>
16+
<description value="This test verifies that mixed nested categories, including Level 5 and higher, with and without children, are loaded properly in the category widget in the admin panel."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-12647"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createBaseCategory"/>
23+
<createData entity="SubCategoryWithParent" stepKey="createLevelTwoCategory">
24+
<field key="name">SubCategoryLvl-2</field>
25+
<field key="parent_id">$$createBaseCategory.id$$</field>
26+
<requiredEntity createDataKey="createBaseCategory"/>
27+
</createData>
28+
<createData entity="SubCategoryWithParent" stepKey="createLevelThreeCategory">
29+
<field key="name">SubCategoryLvl-3</field>
30+
<field key="parent_id">$$createLevelTwoCategory.id$$</field>
31+
<requiredEntity createDataKey="createLevelTwoCategory"/>
32+
</createData>
33+
<createData entity="SubCategoryWithParent" stepKey="createLevelFourCategory">
34+
<field key="name">SubCategoryLvl-4</field>
35+
<field key="parent_id">$$createLevelThreeCategory.id$$</field>
36+
<requiredEntity createDataKey="createLevelThreeCategory"/>
37+
</createData>
38+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveCategory">
39+
<field key="name">SubCategoryLvl-5</field>
40+
<field key="parent_id">$$createLevelFourCategory.id$$</field>
41+
<requiredEntity createDataKey="createLevelFourCategory"/>
42+
</createData>
43+
<createData entity="SubCategoryWithParent" stepKey="createLevelSixCategory">
44+
<field key="name">SubCategoryLvl-6</field>
45+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
46+
<requiredEntity createDataKey="createLevelFiveCategory"/>
47+
</createData>
48+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveSubCategory">
49+
<field key="name">SubCategoryLvl-5-1</field>
50+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
51+
<requiredEntity createDataKey="createLevelFiveCategory"/>
52+
</createData>
53+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveOneSubCategory">
54+
<field key="name">SubCategoryLvl-5-1-1</field>
55+
<field key="parent_id">$$createLevelFiveSubCategory.id$$</field>
56+
<requiredEntity createDataKey="createLevelFiveSubCategory"/>
57+
</createData>
58+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
59+
</before>
60+
<after>
61+
<deleteData createDataKey="createLevelFiveOneSubCategory" stepKey="deleteLevelFiveOneSubCategory"/>
62+
<deleteData createDataKey="createLevelFiveSubCategory" stepKey="deleteLevelFiveSubCategory"/>
63+
<deleteData createDataKey="createLevelSixCategory" stepKey="deleteLevelSixCategory"/>
64+
<deleteData createDataKey="createLevelFiveCategory" stepKey="deleteLevelFiveCategory"/>
65+
<deleteData createDataKey="createLevelFourCategory" stepKey="deleteLevelFourCategory"/>
66+
<deleteData createDataKey="createLevelThreeCategory" stepKey="deleteLevelThreeCategory"/>
67+
<deleteData createDataKey="createLevelTwoCategory" stepKey="deleteLevelTwoCategory"/>
68+
<deleteData createDataKey="createBaseCategory" stepKey="deleteDefaultCategory"/>
69+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
70+
</after>
71+
72+
<!-- Start creating a new widget. Note that we don't need to save it for the cause of the test. -->
73+
<actionGroup ref="AdminCreateSpecificEntityWidgetActionGroup" stepKey="startCreatingWidget">
74+
<argument name="widget" value="CatalogCategoryLinkSpecifiedCategory"/>
75+
</actionGroup>
76+
<click selector="{{AdminNewWidgetSection.storefrontProperties}}" stepKey="clickStorefrontProperties"/>
77+
78+
<!-- Expand all previously created categories one by one. -->
79+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandDefaultCategoryTree">
80+
<argument name="CategoryName" value="Default Category"/>
81+
</actionGroup>
82+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFirstLevelCategoryTree">
83+
<argument name="CategoryName" value="$createBaseCategory.name$"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSecondLevelCategoryTree">
86+
<argument name="CategoryName" value="$createLevelTwoCategory.name$"/>
87+
</actionGroup>
88+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandThirdLevelCategoryTree">
89+
<argument name="CategoryName" value="$createLevelThreeCategory.name$"/>
90+
</actionGroup>
91+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFourthLevelCategoryTree">
92+
<argument name="CategoryName" value="$createLevelFourCategory.name$"/>
93+
</actionGroup>
94+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthLevelCategoryTree">
95+
<argument name="CategoryName" value="$createLevelFiveCategory.name$"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSixthLevelCategoryTree">
98+
<argument name="CategoryName" value="$createLevelSixCategory.name$"/>
99+
</actionGroup>
100+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthSubCategoryTree">
101+
<argument name="CategoryName" value="$createLevelFiveSubCategory.name$"/>
102+
</actionGroup>
103+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthOneSubCategoryTree">
104+
<argument name="CategoryName" value="$createLevelFiveOneSubCategory.name$"/>
105+
</actionGroup>
106+
107+
<!-- Check the total number of expanded categories in the category tree widget ensuring all of them are loaded. -->
108+
<actionGroup ref="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup" stepKey="checkCategoryCount">
109+
<argument name="ExpectedCount" value="9"/>
110+
</actionGroup>
111+
</test>
112+
</tests>

app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<element name="templateByIndex" type="select" selector="select[name='widget_instance[{{index}}][pages][template]']" parameterized="true"/>
2828
<element name="selectTemplate" type="select" selector=".widget-layout-updates .block_template_container .select"/>
2929
<element name="widgetOptions" type="select" selector="#widget_instace_tabs_properties_section"/>
30+
<element name="storefrontProperties" type="select" selector="#widget_instace_tabs_main_section"/>
3031
<element name="addNewCondition" type="select" selector=".rule-param.rule-param-new-child"/>
3132
<element name="selectCondition" type="input" selector="#conditions__1__new_child"/>
3233
<element name="conditionOperator" type="button" selector="#conditions__1__children>li:nth-child(1)>span:nth-child(3) a"/>
@@ -55,7 +56,7 @@
5556
<element name="numberOfProductsToDisplay" type="input" selector="[name='parameters[products_count]']"/>
5657
<element name="template" type="select" selector="[name='parameters[template]']"/>
5758
<element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/>
58-
<element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
59+
<element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
5960
<element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/>
6061
</section>
6162
</sections>

0 commit comments

Comments
 (0)