|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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 when negative page number requested"/> |
| 15 | + <description value="Pagination should reset on storefront when negative page number requested"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <testCaseId value=""/> |
| 18 | + <useCaseId value=""/> |
| 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 | + </before> |
| 30 | + <after> |
| 31 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 32 | + <deleteData createDataKey="createSimpleProductOne" stepKey="deleteProductOne"/> |
| 33 | + <deleteData createDataKey="createSimpleProductTwo" stepKey="deleteProductTwo"/> |
| 34 | + </after> |
| 35 | + <!-- Go to category page with `-1` as a Page Number --> |
| 36 | + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}?p=-1" stepKey="goToStorefrontCreatedCategoryPage"/> |
| 37 | + <!-- Expect redirect to the base URL of category, without any pagination --> |
| 38 | + <actionGroup ref="AdminGridAssertCurrentPageNumberActionGroup" stepKey="assertCurrentPageIsTwoOnProductGridFirstSearch"> |
| 39 | + <argument name="expectedCurrentPageNumber" value="1"/> |
| 40 | + </actionGroup> |
| 41 | + <!-- Validate that "no products found" error message is not present --> |
| 42 | + <actionGroup ref="StorefrontDontSeeNoProductsFoundActionGroup" stepKey="dontSeeNoProdsFoundMessage"/> |
| 43 | + <!-- Verify the products are visible on the Category Page --> |
| 44 | + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeProductOneOnGrid"> |
| 45 | + <argument name="productName" value="$$createSimpleProductOne.name$$"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeProductTwoOnGrid"> |
| 48 | + <argument name="productName" value="$$createSimpleProductTwo.name$$"/> |
| 49 | + </actionGroup> |
| 50 | + </test> |
| 51 | +</tests> |
0 commit comments