|
| 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="StorefrontPaginationResetOnViewModeChange"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Product grid"/> |
| 14 | + <title value="Pagination should reset on storefront upon view mode switching"/> |
| 15 | + <description value="Pagination should reset on storefront upon view mode switching"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <testCaseId value="AC-2652"/> |
| 18 | + <useCaseId value="ACP2E-657"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="createSimpleProductOne"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProductTwo"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <magentoCLI command="config:set {{CustomGridPerPageValuesConfigData.path}} {{CustomGridPerPageValuesConfigData.value}}" stepKey="setCustomGridPerPageValues"/> |
| 30 | + <magentoCLI command="config:set {{CustomGridPerPageDefaultConfigData.path}} {{CustomGridPerPageDefaultConfigData.value}}" stepKey="setCustomGridPerPageDefaults"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + <deleteData createDataKey="createSimpleProductOne" stepKey="deleteProductOne"/> |
| 35 | + <deleteData createDataKey="createSimpleProductTwo" stepKey="deleteProductTwo"/> |
| 36 | + <magentoCLI command="config:set {{DefaultGridPerPageValuesConfigData.path}} {{DefaultGridPerPageValuesConfigData.value}}" stepKey="setDefaultGridPerPageValues"/> |
| 37 | + <magentoCLI command="config:set {{DefaultGridPerPageDefaultConfigData.path}} {{DefaultGridPerPageDefaultConfigData.value}}" stepKey="setDefaultGridPerPageDefaults"/> |
| 38 | + </after> |
| 39 | + |
| 40 | + <!-- Go to category page with the default grid mode view, 1 product per page --> |
| 41 | + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/> |
| 42 | + <!-- Go to second page of the product list and validate that Prod1 is not visible and Prod2 is visible --> |
| 43 | + <actionGroup ref="StorefrontNavigateCategoryNextPageActionGroup" stepKey="goToNextPage"/> |
| 44 | + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeProdTwoOnGrid"> |
| 45 | + <argument name="productName" value="$$createSimpleProductTwo.name$$"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProdOneOnGrid"> |
| 48 | + <argument name="productName" value="$$createSimpleProductOne.name$$"/> |
| 49 | + </actionGroup> |
| 50 | + |
| 51 | + <!-- Switch to list view with 10 products per page and only one page of products available --> |
| 52 | + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchViewToList"/> |
| 53 | + <!-- Validate that "no products found" error message is not present --> |
| 54 | + <actionGroup ref="StorefrontDontSeeNoProductsFoundActionGroup" stepKey="dontSeeNoProdsFoundMessage"/> |
| 55 | + <!-- Validate that there is no pagination control visible as we only have one page of products --> |
| 56 | + <dontSeeElement selector="{{StorefrontCategoryBottomToolbarSection.currentPage}}" stepKey="dontSeePaginationControl"/> |
| 57 | + <!-- Validate both products are present on the page --> |
| 58 | + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeProdOneOnList"> |
| 59 | + <argument name="productName" value="$$createSimpleProductOne.name$$"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeProdTwoOnList"> |
| 62 | + <argument name="productName" value="$$createSimpleProductTwo.name$$"/> |
| 63 | + </actionGroup> |
| 64 | + |
| 65 | + <!-- Rollback the view mode to the default grid --> |
| 66 | + <actionGroup ref="StorefrontSwitchCategoryViewToGridModeActionGroup" stepKey="switchToGridMode"/> |
| 67 | + </test> |
| 68 | +</tests> |
0 commit comments