Skip to content

Commit 92c6dbd

Browse files
committed
ACP2E-816: Magento 2.4.4 frontend menu mobile
1 parent 5658010 commit 92c6dbd

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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="StorefrontCategorySidebarMobileMenuTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Storefront main menu in mobile view should allow expanding categories with children"/>
15+
<title value="Storefront main menu in mobile view should allow expanding categories with children"/>
16+
<description value="Storefront main menu in mobile view should allow expanding categories with children"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-6596"/>
19+
<useCaseId value="ACP2E-816"/>
20+
<group value="Catalog"/>
21+
</annotations>
22+
<before>
23+
<!-- Set the window size to trigger mobile layout -->
24+
<resizeWindow width="400" height="590" stepKey="resizeWindowToMobileView"/>
25+
<createData entity="ApiCategory" stepKey="createParentCategory"/>
26+
<createData entity="NewSubCategoryWithParent" stepKey="createSubCategory">
27+
<requiredEntity createDataKey="createParentCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<!-- Reset the window size to its original state -->
32+
<resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/>
33+
<deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/>
34+
<deleteData createDataKey="createParentCategory" stepKey="deleteParentCategory"/>
35+
</after>
36+
37+
<!-- Open the storefront home -->
38+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStorefrontPage"/>
39+
40+
<!-- Open the side menu and expand the root category -->
41+
<click selector="{{StorefrontHeaderSection.mobileMenuToggle}}" stepKey="openSideMenu"/>
42+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="expandCategoryMenu"/>
43+
44+
<!-- Assert the category expanded successfully -->
45+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="verifySubCatMenuItemIsVisibleInTheSidebar">
46+
<argument name="categoryName" value="$$createSubCategory.name$$"/>
47+
</actionGroup>
48+
49+
<!-- Open the subcategory and assert it opened successfully -->
50+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="openSubCategory"/>
51+
<see userInput="$$createSubCategory.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
52+
</test>
53+
</tests>

app/code/Magento/Theme/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<element name="welcomeMessage" type="text" selector=".greet.welcome"/>
1212
<element name="logoLink" type="button" selector=".header .logo"/>
1313
<element name="logoImage" type="button" selector=".header .logo > img[src*='{{filename}}']" parameterized="true"/>
14+
<element name="mobileMenuToggle" type="button" selector=".header .nav-toggle"/>
1415
</section>
1516
</sections>

0 commit comments

Comments
 (0)