Skip to content

Commit adfd7f0

Browse files
committed
MAGETWO-98748: Incorrect behavior in the category menu on the Storefront
- Updated automated test script.
1 parent 418ab8d commit adfd7f0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="categoryTreeRoot" type="text" selector="div.x-tree-root-node>li.x-tree-node:first-of-type>div.x-tree-node-el:first-of-type" timeout="30"/>
1515
<element name="categoryInTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
1616
<element name="categoryHighlighted" type="text" selector="//ul[@id='ui-id-2']//li//a/span[contains(text(),'{{name}}')]/../.." parameterized="true" timeout="30"/>
17+
<element name="categoryNotHighlighted" type="text" selector="ul[id=\'ui-id-2\'] li[class~=\'active\']" timeout="30"/>
1718
<element name="categoryInTreeUnderRoot" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{name}}')]" parameterized="true"/>
1819
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
1920
<element name="treeContainer" type="block" selector=".tree-holder" />

app/code/Magento/Catalog/Test/Mftf/Test/CheckCategoriesFunctionality.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
<comment userInput="Click on first category" stepKey="openFirstCategoryPage"/>
4949
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category1.name$$)}}" stepKey="clickCategory1Name"/>
5050
<waitForPageLoad stepKey="waitForCategory1Page"/>
51-
<!--Check if current category is highlighted-->
52-
<comment userInput="Check if current category is highlighted" stepKey="checkCateg1NameIsHighlighted"/>
51+
<!--Check if current category is highlighted and the others are not-->
52+
<comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg1NameIsHighlighted"/>
5353
<grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category1.name$$)}}" userInput="class" stepKey="grabCategory1Class"/>
5454
<assertContains expectedType="string" expected="active" actual="$grabCategory1Class" stepKey="assertCategory1IsHighlighted"/>
55+
<executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount"/>
56+
<assertEquals expectedType="int" expected="1" actual="$highlightedAmount" stepKey="assertRestCategories1IsNotHighlighted"/>
5557
<!--See products in the category page-->
5658
<comment userInput="See products in the category page" stepKey="seeProductsInCategoryPage"/>
5759
<seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product1.name$)}}" stepKey="seeProduct1InCategoryPage"/>
@@ -60,9 +62,11 @@
6062
<comment userInput="Click on second category" stepKey="openSecondCategoryPage"/>
6163
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category2.name$$)}}" stepKey="clickCategory2Name"/>
6264
<waitForPageLoad stepKey="waitForCategory2Page"/>
63-
<!--Check if current category is highlighted-->
64-
<comment userInput="Check if current category is highlighted" stepKey="checkCateg2NameIsHighlighted"/>
65+
<!--Check if current category is highlighted and the others are not-->
66+
<comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg2NameIsHighlighted"/>
6567
<grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category2.name$$)}}" userInput="class" stepKey="grabCategory2Class"/>
6668
<assertContains expectedType="string" expected="active" actual="$grabCategory2Class" stepKey="assertCategory2IsHighlighted"/>
69+
<executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount2"/>
70+
<assertEquals expectedType="int" expected="1" actual="$highlightedAmount2" stepKey="assertRestCategories1IsNotHighlighted2"/>
6771
</test>
6872
</tests>

0 commit comments

Comments
 (0)