|
| 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> |
0 commit comments