|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/************************************************************************ |
| 4 | + * |
| 5 | + * Copyright 2024 Adobe |
| 6 | + * All Rights Reserved. |
| 7 | + * |
| 8 | + * NOTICE: All information contained herein is, and remains |
| 9 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 10 | + * and technical concepts contained herein are proprietary to Adobe |
| 11 | + * and its suppliers and are protected by all applicable intellectual |
| 12 | + * property laws, including trade secret and copyright laws. |
| 13 | + * Dissemination of this information or reproduction of this material |
| 14 | + * is strictly forbidden unless prior written permission is obtained |
| 15 | + * from Adobe. |
| 16 | + * ************************************************************************ |
| 17 | + */ |
| 18 | +--> |
| 19 | + |
| 20 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 21 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 22 | + <test name="StorefrontMultipleSelectAttributeInLayeredNavigationTest"> |
| 23 | + <annotations> |
| 24 | + <features value="LayeredNavigation"/> |
| 25 | + <stories value="Product attributes in Layered Navigation"/> |
| 26 | + <title value="In Layered Navigation, attribute options with values of 0 are displayed just like other values or label."/> |
| 27 | + <description value="Filtering by dropdown attribute in Layered navigation for option value 0."/> |
| 28 | + <severity value="CRITICAL"/> |
| 29 | + <useCaseId value="ACP2E-3058"/> |
| 30 | + <testCaseId value="AC-11974"/> |
| 31 | + <group value="layeredNavigation"/> |
| 32 | + <group value="catalog"/> |
| 33 | + </annotations> |
| 34 | + <before> |
| 35 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 36 | + <!-- Create multi select product attribute --> |
| 37 | + <createData entity="productAttributeMultiselectTwoOptions" stepKey="createMultiSelectProductAttribute"/> |
| 38 | + <!-- Add options to created product attribute --> |
| 39 | + <createData entity="productAttributeOption" stepKey="addFirstOptionToAttribute"> |
| 40 | + <field key="label">-1</field> |
| 41 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 42 | + </createData> |
| 43 | + <createData entity="productAttributeOption" stepKey="addSecondOptionToAttribute"> |
| 44 | + <field key="label">0</field> |
| 45 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 46 | + </createData> |
| 47 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstMultiselectProductAttributeOption"> |
| 48 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 49 | + </getData> |
| 50 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondMultiselectProductAttributeOption"> |
| 51 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 52 | + </getData> |
| 53 | + <createData entity="AddToDefaultSet" stepKey="AddDropdownProductAttributeToAttributeSet"> |
| 54 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 55 | + </createData> |
| 56 | + <!-- Assign attribute value to created products --> |
| 57 | + <createData entity="ApiSimpleProductWithCategory" stepKey="createSimpleProduct1"> |
| 58 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 59 | + <requiredEntity createDataKey="getFirstMultiselectProductAttributeOption"/> |
| 60 | + <requiredEntity createDataKey="createCategory"/> |
| 61 | + </createData> |
| 62 | + <createData entity="ApiSimpleProductWithCategory" stepKey="createSimpleProduct2"> |
| 63 | + <requiredEntity createDataKey="createMultiSelectProductAttribute"/> |
| 64 | + <requiredEntity createDataKey="getSecondMultiselectProductAttributeOption"/> |
| 65 | + <requiredEntity createDataKey="createCategory"/> |
| 66 | + </createData> |
| 67 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices"> |
| 68 | + <argument name="indices" value=""/> |
| 69 | + </actionGroup> |
| 70 | + <!-- Login to Admin page --> |
| 71 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 72 | + </before> |
| 73 | + <after> |
| 74 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 75 | + <deleteData createDataKey="createSimpleProduct1" stepKey="deleteFirstProduct"/> |
| 76 | + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSecondProduct"/> |
| 77 | + <deleteData createDataKey="createMultiSelectProductAttribute" stepKey="deleteMultiSelectProductAttribute"/> |
| 78 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices"> |
| 79 | + <argument name="indices" value=""/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 82 | + </after> |
| 83 | + <!-- Go to admin > product(second) edit page --> |
| 84 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 85 | + <argument name="productId" value="$createSimpleProduct2.id$"/> |
| 86 | + </actionGroup> |
| 87 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 88 | + |
| 89 | + <!-- Open storefront category --> |
| 90 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategory"> |
| 91 | + <argument name="category" value="$createCategory$"/> |
| 92 | + </actionGroup> |
| 93 | + |
| 94 | + <!-- Check filtration options for created attribute. All attribute options should be displayed --> |
| 95 | + <actionGroup ref="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup" stepKey="assertAttributeOption1PresentInLayeredNavigation"> |
| 96 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 97 | + <argument name="attributeOptionLabel" value="$getFirstMultiselectProductAttributeOption.label$"/> |
| 98 | + <argument name="attributeOptionPosition" value="1"/> |
| 99 | + </actionGroup> |
| 100 | + <!-- Click on the storefront layered navigation first attribute option --> |
| 101 | + <actionGroup ref="StorefrontFilterCategoryPageByAttributeOptionActionGroup" stepKey="filterCategoryByFirstOption1"> |
| 102 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 103 | + <argument name="attributeOptionLabel" value="$getFirstMultiselectProductAttributeOption.label$"/> |
| 104 | + </actionGroup> |
| 105 | + <!-- Verify storefront layered navigation first attribute value --> |
| 106 | + <actionGroup ref="StorefrontLayeredNavigationAttributeOptionActionGroup" stepKey="VerifyAttributeOptionValueForFirstProduct"> |
| 107 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 108 | + <argument name="attributeOptionLabel" value="$getFirstMultiselectProductAttributeOption.label$"/> |
| 109 | + </actionGroup> |
| 110 | + |
| 111 | + <!--Check filtration options for created attribute. All attribute options should be displayed --> |
| 112 | + <actionGroup ref="AssertStorefrontAttributeOptionPresentInLayeredNavigationActionGroup" stepKey="assertAttributeOption2PresentInLayeredNavigation"> |
| 113 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 114 | + <argument name="attributeOptionLabel" value="$getSecondMultiselectProductAttributeOption.label$"/> |
| 115 | + <argument name="attributeOptionPosition" value="2"/> |
| 116 | + </actionGroup> |
| 117 | + <!-- Click on the storefront layered navigation second attribute option --> |
| 118 | + <actionGroup ref="StorefrontFilterCategoryPageByAttributeOptionActionGroup" stepKey="filterCategoryBySecondOption2"> |
| 119 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 120 | + <argument name="attributeOptionLabel" value="$getSecondMultiselectProductAttributeOption.label$"/> |
| 121 | + </actionGroup> |
| 122 | + <!-- Verify storefront layered navigation second attribute value --> |
| 123 | + <actionGroup ref="StorefrontLayeredNavigationAttributeOptionActionGroup" stepKey="VerifyAttributeOptionValueForSecondProduct"> |
| 124 | + <argument name="attributeLabel" value="$createMultiSelectProductAttribute.attribute[frontend_labels][0][label]$"/> |
| 125 | + <argument name="attributeOptionLabel" value="$getSecondMultiselectProductAttributeOption.label$"/> |
| 126 | + </actionGroup> |
| 127 | + </test> |
| 128 | +</tests> |
0 commit comments