|
| 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="StorefrontRedirectToFirstPageOnFilteringBySwatchTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Swatches"/> |
| 14 | + <stories value="Filter by swatch attribute on plp layered navigation"/> |
| 15 | + <title value="Customers are redirected to first plp page after filtering by swatch"/> |
| 16 | + <description value="Customers are redirected to first plp page after filtering by swatch"/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + <group value="Swatches"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct1"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct2"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct3"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <magentoCLI command="config:set catalog/frontend/grid_per_page 1" stepKey="setOneProductPerPage"/> |
| 34 | + <magentoCLI command="config:set catalog/frontend/grid_per_page_values 1" stepKey="setGridPerPage"/> |
| 35 | + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> |
| 36 | + |
| 37 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 38 | + <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addSwatchAttribute"> |
| 39 | + <argument name="usedInLayeredNavigation" value="1"/> |
| 40 | + </actionGroup> |
| 41 | + </before> |
| 42 | + |
| 43 | + <after> |
| 44 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSwatchAttribute"> |
| 45 | + <argument name="ProductAttribute" value="textSwatchAttribute"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 48 | + |
| 49 | + <magentoCLI command="config:set catalog/frontend/grid_per_page 12" stepKey="setDefaultProductsPerPage"/> |
| 50 | + <magentoCLI command="config:set catalog/frontend/grid_per_page_values 12,24,36" stepKey="setDefaultGridPerPage"/> |
| 51 | + <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> |
| 52 | + |
| 53 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 54 | + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 55 | + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 56 | + <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> |
| 57 | + </after> |
| 58 | + |
| 59 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> |
| 60 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 61 | + <argument name="group" value="Product Details"/> |
| 62 | + <argument name="attribute" value="{{textSwatchAttribute.attribute_code}}"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> |
| 65 | + |
| 66 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductsGridPage"/> |
| 67 | + |
| 68 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="goToProduct1EditPage"> |
| 69 | + <argument name="product" value="$$createSimpleProduct1$$"/> |
| 70 | + </actionGroup> |
| 71 | + <selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(textSwatchAttribute.attribute_code)}}" userInput="textSwatchOption1" stepKey="selectProduct1AttributeOption"/> |
| 72 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> |
| 73 | + |
| 74 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductsGridPage2"/> |
| 75 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="goToProduct2EditPage"> |
| 76 | + <argument name="product" value="$$createSimpleProduct2$$"/> |
| 77 | + </actionGroup> |
| 78 | + <selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(textSwatchAttribute.attribute_code)}}" userInput="textSwatchOption1" stepKey="selectProduct2AttributeOption"/> |
| 79 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> |
| 80 | + |
| 81 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductsGridPage3"/> |
| 82 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="goToProduct3EditPage"> |
| 83 | + <argument name="product" value="$$createSimpleProduct3$$"/> |
| 84 | + </actionGroup> |
| 85 | + <selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(textSwatchAttribute.attribute_code)}}" userInput="textSwatchOption2" stepKey="selectProduct3AttributeOption"/> |
| 86 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> |
| 87 | + |
| 88 | + <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> |
| 89 | + |
| 90 | + <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> |
| 91 | + <waitForPageLoad stepKey="waitForPageToLoad"/> |
| 92 | + |
| 93 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton"/> |
| 94 | + <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage"/> |
| 95 | + <waitForPageLoad stepKey="waitForPageToLoad2"/> |
| 96 | + |
| 97 | + <click selector="{{StorefrontCategorySidebarSection.filterOptionTitle(textSwatchAttribute.default_label)}}" stepKey="expandAttribute"/> |
| 98 | + <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(textSwatchAttribute.attribute_code, '1')}}" stepKey="filterBySwatch1"/> |
| 99 | + <waitForPageLoad stepKey="waitForPageToLoad3"/> |
| 100 | + |
| 101 | + <actionGroup ref="AssertStorefrontCategoryCurrentPageIsFirstActionGroup" stepKey="assertCurrentPageIsFirst"/> |
| 102 | + </test> |
| 103 | +</tests> |
0 commit comments