|
| 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="StorefrontFilterableProductAttributeInLayeredNavigationWithoutReindexTest"> |
| 12 | + <annotations> |
| 13 | + <features value="LayeredNavigation"/> |
| 14 | + <stories value="Magento_LayeredNavigation"/> |
| 15 | + <title value="Create and add new dropdown product attribute to existing set, assign it to existing product with that set and see it on layered navigation"/> |
| 16 | + <description value="Verify that new dropdown attribute in existing attribute set shows on layered navigation on storefront without reindex"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="MC-35954"/> |
| 19 | + <group value="layeredNavigation"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <!--Create category, attribute set with multiselect product attribute with two options--> |
| 24 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 25 | + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> |
| 26 | + <createData entity="multipleSelectProductAttribute" stepKey="createMultiselectAttribute"/> |
| 27 | + <createData entity="ProductAttributeOption10" stepKey="firstMultiselectOption"> |
| 28 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 29 | + </createData> |
| 30 | + <createData entity="ProductAttributeOption11" stepKey="secondMultiselectOption"> |
| 31 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 32 | + </createData> |
| 33 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstMultiselectOption"> |
| 34 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 35 | + </getData> |
| 36 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondMultiselectOption"> |
| 37 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 38 | + </getData> |
| 39 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 40 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" stepKey="onAttributeSetEdit"/> |
| 41 | + <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> |
| 42 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignMultiselectAttributeToGroup"> |
| 43 | + <argument name="group" value="Product Details"/> |
| 44 | + <argument name="attribute" value="$createMultiselectAttribute.attribute_code$"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 47 | + <!--Create configurable product with created attribute set and multiselect attribute--> |
| 48 | + <createData entity="SimpleOne" storeCode="all" stepKey="createFirstSimpleProduct"> |
| 49 | + <field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field> |
| 50 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 51 | + <requiredEntity createDataKey="getFirstMultiselectOption"/> |
| 52 | + </createData> |
| 53 | + <createData entity="SimpleOne" storeCode="all" stepKey="createSecondSimpleProduct"> |
| 54 | + <field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field> |
| 55 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 56 | + <requiredEntity createDataKey="getSecondMultiselectOption"/> |
| 57 | + </createData> |
| 58 | + <createData entity="BaseConfigurableProduct" stepKey="createConfigurableProduct"> |
| 59 | + <field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field> |
| 60 | + <requiredEntity createDataKey="createCategory"/> |
| 61 | + </createData> |
| 62 | + <createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption"> |
| 63 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 64 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 65 | + <requiredEntity createDataKey="getFirstMultiselectOption"/> |
| 66 | + </createData> |
| 67 | + <createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption2"> |
| 68 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 69 | + <requiredEntity createDataKey="createMultiselectAttribute"/> |
| 70 | + <requiredEntity createDataKey="getSecondMultiselectOption"/> |
| 71 | + </createData> |
| 72 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 73 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 74 | + <requiredEntity createDataKey="createFirstSimpleProduct"/> |
| 75 | + </createData> |
| 76 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 77 | + <requiredEntity createDataKey="createConfigurableProduct"/> |
| 78 | + <requiredEntity createDataKey="createSecondSimpleProduct"/> |
| 79 | + </createData> |
| 80 | + <!--Create new dropdown attribute with two options and set Use in layered navigation "Filterable (no results)"--> |
| 81 | + <createData entity="dropdownProductAttribute" stepKey="createDropdownAttribute"/> |
| 82 | + <createData entity="ProductAttributeOption10" stepKey="firstDropdownOption"> |
| 83 | + <requiredEntity createDataKey="createDropdownAttribute"/> |
| 84 | + </createData> |
| 85 | + <createData entity="ProductAttributeOption11" stepKey="secondDropdownOption"> |
| 86 | + <requiredEntity createDataKey="createDropdownAttribute"/> |
| 87 | + </createData> |
| 88 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstDropdownOption"> |
| 89 | + <requiredEntity createDataKey="createDropdownAttribute"/> |
| 90 | + </getData> |
| 91 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondDropdownOption"> |
| 92 | + <requiredEntity createDataKey="createDropdownAttribute"/> |
| 93 | + </getData> |
| 94 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="goToDropdownAttributePage"> |
| 95 | + <argument name="productAttributeCode" value="$createDropdownAttribute.attribute_code$"/> |
| 96 | + </actionGroup> |
| 97 | + <actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults"> |
| 98 | + <argument name="useInLayeredNavigationValue" value="Filterable (no results)"/> |
| 99 | + </actionGroup> |
| 100 | + <actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveDropdownAttribute"/> |
| 101 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 102 | + </before> |
| 103 | + |
| 104 | + <after> |
| 105 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 106 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 107 | + <deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> |
| 108 | + <deleteData createDataKey="createMultiselectAttribute" stepKey="deleteMultiselectAttribute"/> |
| 109 | + <deleteData createDataKey="createDropdownAttribute" stepKey="deleteDropdownAttribute"/> |
| 110 | + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> |
| 111 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 112 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
| 113 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 114 | + </after> |
| 115 | + |
| 116 | + <!--Set attribute option Use in layered navigation to "Filterable(no results)"--> |
| 117 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="goToMultiselectAttributePage"> |
| 118 | + <argument name="productAttributeCode" value="$createMultiselectAttribute.attribute_code$"/> |
| 119 | + </actionGroup> |
| 120 | + <actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setMultiselectUseInLayeredNavigationNoResults"> |
| 121 | + <argument name="useInLayeredNavigationValue" value="Filterable (no results)"/> |
| 122 | + </actionGroup> |
| 123 | + <actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveMultiselectAttribute"/> |
| 124 | + <amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="onCategoryPage"/> |
| 125 | + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> |
| 126 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle($createMultiselectAttribute.default_frontend_label$)}}" stepKey="waitForMultiselectAttributeVisible"/> |
| 127 | + <conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle($createMultiselectAttribute.default_frontend_label$)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/> |
| 128 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForMultiselectAttributeOptionsVisible"/> |
| 129 | + <seeElement selector="{{StorefrontCategorySidebarSection.enabledFilterOptionItemByLabel($getFirstMultiselectOption.label$)}}" stepKey="assertMultiselectAttributeFirstOptionInLayeredNavigation"/> |
| 130 | + <seeElement selector="{{StorefrontCategorySidebarSection.enabledFilterOptionItemByLabel($getSecondMultiselectOption.label$)}}" stepKey="assertMultiselectAttributeSecondOptionInLayeredNavigation"/> |
| 131 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" stepKey="onAttributeSetEditPage"/> |
| 132 | + <waitForPageLoad stepKey="waitForAttributeSetEditPageLoad"/> |
| 133 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignDropdownAttributeToGroup"> |
| 134 | + <argument name="group" value="Product Details"/> |
| 135 | + <argument name="attribute" value="$createDropdownAttribute.attribute_code$"/> |
| 136 | + </actionGroup> |
| 137 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSetWithDropdownAttribute"/> |
| 138 | + <!--Assign dropdown attribute to child product of configurable--> |
| 139 | + <amOnPage url="{{AdminProductEditPage.url($createFirstSimpleProduct.id$)}}" stepKey="visitAdminEditProductPage"/> |
| 140 | + <waitForElementVisible selector="{{AdminProductFormSection.customSelectField('$createDropdownAttribute.attribute_code$')}}" stepKey="waitForDropdownAttributeSelectVisible"/> |
| 141 | + <selectOption selector="{{AdminProductFormSection.customSelectField('$createDropdownAttribute.attribute_code$')}}" userInput="$getFirstDropdownOption.label$" stepKey="selectValueOfNewAttribute"/> |
| 142 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> |
| 143 | + <!--Assert that dropdown attribute is present on layered navigation with both options--> |
| 144 | + <amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/> |
| 145 | + <waitForPageLoad stepKey="waitForCategoryPageLoadWithDropdownAttribute"/> |
| 146 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle($createDropdownAttribute.default_frontend_label$)}}" stepKey="waitForDropdownAttributeVisible"/> |
| 147 | + <conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle($createDropdownAttribute.default_frontend_label$)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandDropdownAttribute"/> |
| 148 | + <waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForDropdownAttributeOptionsVisible"/> |
| 149 | + <seeElement selector="{{StorefrontCategorySidebarSection.enabledFilterOptionItemByLabel($getFirstDropdownOption.label$)}}" stepKey="assertDropdownAttributeFirstOptionInLayeredNavigation"/> |
| 150 | + <seeElement selector="{{StorefrontCategorySidebarSection.disabledFilterOptionItemByLabel($getSecondDropdownOption.label$)}}" stepKey="assertDropdownAttributeSecondOptionInLayeredNavigation"/> |
| 151 | + </test> |
| 152 | +</tests> |
0 commit comments