|
| 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="SwatchesAreVisibleInLayeredNavigationTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Swatches"/> |
| 14 | + <stories value="Swatches are visible in Layered Navigation"/> |
| 15 | + <title value="Swatches are visible in Layered Navigation"/> |
| 16 | + <description value="Swatches are visible in Layered Navigation"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4154"/> |
| 19 | + <group value="Swatches"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <deleteData createDataKey="createConfigurableProduct1" stepKey="deleteConfigurableProduct1"/> |
| 26 | + <deleteData createDataKey="createConfigurableProduct2" stepKey="deleteConfigurableProduct2"/> |
| 27 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 28 | + <deleteData createDataKey="createTextSwatchAttribute" stepKey="deleteTextSwatchAttribute"/> |
| 29 | + <deleteData createDataKey="createVisualSwatchAttribute" stepKey="deleteVisualSwatchAttribute"/> |
| 30 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 31 | + </after> |
| 32 | + <!-- Create 2 Configurable products --> |
| 33 | + <createData entity="_defaultCategory" stepKey="createCategory" /> |
| 34 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct1"> |
| 35 | + <requiredEntity createDataKey="createCategory"/> |
| 36 | + </createData> |
| 37 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct2"> |
| 38 | + <requiredEntity createDataKey="createCategory"/> |
| 39 | + </createData> |
| 40 | + <!-- Create product visual swatch attribute --> |
| 41 | + <createData entity="VisualSwatchProductAttributeForm" stepKey="createVisualSwatchAttribute"/> |
| 42 | + <createData entity="SwatchProductAttributeOption1" stepKey="visualSwatchAttributeOption"> |
| 43 | + <requiredEntity createDataKey="createVisualSwatchAttribute"/> |
| 44 | + </createData> |
| 45 | + <!-- Create product text swatch attribute --> |
| 46 | + <createData entity="TextSwatchProductAttributeForm" stepKey="createTextSwatchAttribute"/> |
| 47 | + <createData entity="SwatchProductAttributeOption1" stepKey="textSwatchAttributeOption"> |
| 48 | + <requiredEntity createDataKey="createTextSwatchAttribute"/> |
| 49 | + </createData> |
| 50 | + <magentoCLI stepKey="reindexPostCreating2Attributes" command="indexer:reindex"/> |
| 51 | + <magentoCLI stepKey="flushCachePostCreating2Attributes" command="cache:flush"/> |
| 52 | + <!-- Go to the edit page for the visual Swatch attribute --> |
| 53 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributesToEditVisualSwatchAttribute"/> |
| 54 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillFilterToEditVisualSwatchAttribute"/> |
| 55 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchToEditVisualSwatchAttribute"/> |
| 56 | + <click selector="{{AdminProductAttributeGridSection.AttributeCode('$createVisualSwatchAttribute.attribute_code$')}}" stepKey="clickVisualSwatchRowToEdit"/> |
| 57 | + <click selector="{{AdminManageSwatchSection.swatchWindowEdit('1')}}" stepKey="clickSwatchButtonToEdit"/> |
| 58 | + <click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/> |
| 59 | + <attachFile selector="input[name='datafile']" userInput="adobe-thumb.jpg" stepKey="attachFile1"/> |
| 60 | + <waitForPageLoad stepKey="waitFileAttached1"/> |
| 61 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEditForVisualSwatchAttribute"/> |
| 62 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessForVisualSwatchAttribute"/> |
| 63 | + <!-- Go to the edit page for the text Swatch attribute --> |
| 64 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributesToEditTextSwatchAttribute"/> |
| 65 | + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$createTextSwatchAttribute.attribute_code$" stepKey="fillFilterToEditTextSwatchAttribute"/> |
| 66 | + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchToEditTextSwatchAttribute"/> |
| 67 | + <click selector="{{AdminProductAttributeGridSection.AttributeCode('$createTextSwatchAttribute.attribute_code$')}}" stepKey="clickTextSwatchRowToEdit"/> |
| 68 | + <fillField selector="{{AdminManageSwatchSection.updateSwatchText('1')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionAdminName"/> |
| 69 | + <fillField selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('1')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDescription"/> |
| 70 | + <fillField selector="{{AdminManageSwatchSection.updateSwatchText('2')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDefaultStoreViewName"/> |
| 71 | + <fillField selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('2')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDefaultStoreViewDescription"/> |
| 72 | + <grabValueFrom selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('2')}}" stepKey="grabTextValue"/> |
| 73 | + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEditForTextSwatchAttribute"/> |
| 74 | + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessForTextSwatchAttribute"/> |
| 75 | + <!-- Update Config product1 visual swatch attribute --> |
| 76 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigurableProduct1"> |
| 77 | + <argument name="product" value="$$createConfigurableProduct1$$"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductForConfigurableProduct1"> |
| 80 | + <argument name="product" value="$$createConfigurableProduct1$$"/> |
| 81 | + </actionGroup> |
| 82 | + <!-- Edit the configurable product 1 --> |
| 83 | + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnTheCreateConfigurationsButtonForConfigProd1"/> |
| 84 | + <waitForPageLoad time="30" stepKey="waitForPageLoadForConfigProd1"/> |
| 85 | + <click selector="{{AdminGridRow.checkboxByValue('$createVisualSwatchAttribute.frontend_label[0]$')}}" stepKey="selectVisualSwatchAttributeForConfigProd1"/> |
| 86 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToSecondStepForConfigProd1"/> |
| 87 | + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="selectOption1ForConfigProd1"/> |
| 88 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToThirdStepForConfigProd1"/> |
| 89 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSKUsForConfigProd1"/> |
| 90 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="fillPriceForEachSKUForConfigProd1"/> |
| 91 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQtyToEachSKUsForConfigProd1"/> |
| 92 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="10" stepKey="fillQuantityForEachSKUForConfigProd1"/> |
| 93 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToFourthStepForConfigProd1"/> |
| 94 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="doneGeneratingConfigurableVariationsForConfigProd1"/> |
| 95 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductForConfigProd1"/> |
| 96 | + <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProductForConfigProd1"/> |
| 97 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessageForConfigProd1"/> |
| 98 | + <!-- Update Config product2 visual swatch attribute --> |
| 99 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigurableProduct2"> |
| 100 | + <argument name="product" value="$$createConfigurableProduct2$$"/> |
| 101 | + </actionGroup> |
| 102 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductForConfigurableProduct2"> |
| 103 | + <argument name="product" value="$$createConfigurableProduct2$$"/> |
| 104 | + </actionGroup> |
| 105 | + <!-- Edit the configurable product 2 --> |
| 106 | + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnTheCreateConfigurationsButtonForConfigProd2"/> |
| 107 | + <waitForPageLoad time="30" stepKey="waitForPageLoadForConfigProd2"/> |
| 108 | + <click selector="{{AdminGridRow.checkboxByValue('$createTextSwatchAttribute.frontend_label[0]$')}}" stepKey="selectVisualSwatchAttributeForConfigProd2"/> |
| 109 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToSecondStepForConfigProd2"/> |
| 110 | + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="selectOption1ForConfigProd2"/> |
| 111 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToThirdStepForConfigProd2"/> |
| 112 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSKUsForConfigProd2"/> |
| 113 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="fillPriceForEachSKUForConfigProd2"/> |
| 114 | + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQtyToEachSKUsForConfigProd2"/> |
| 115 | + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="10" stepKey="fillQuantityForEachSKUForConfigProd2"/> |
| 116 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="navigateToFourthStepForConfigProd2"/> |
| 117 | + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="doneGeneratingConfigurableVariationsForConfigProd2"/> |
| 118 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductForConfigProd2"/> |
| 119 | + <conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProductForConfigProd2"/> |
| 120 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessageForConfigProd2"/> |
| 121 | + <!-- Go to the Storefront category page --> |
| 122 | + <amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/> |
| 123 | + <waitForPageLoad stepKey="waitForCategoryPage"/> |
| 124 | + <!-- Verify swatches are present in the layered navigation --> |
| 125 | + <see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="$createVisualSwatchAttribute.frontend_label[0]$" stepKey="seeVisualSwatchAttributeInLayeredNav"/> |
| 126 | + <see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="$createTextSwatchAttribute.frontend_label[0]$" stepKey="seeTextSwatchAttributeInLayeredNav"/> |
| 127 | + <click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createVisualSwatchAttribute.frontend_label[0]$')}}" stepKey="expandVisualSwatchAttribute"/> |
| 128 | + <moveMouseOver selector="{{StorefrontCategorySidebarSection.expandedSwatchThumbnails('$createVisualSwatchAttribute.frontend_label[0]$','swatch-option')}}" stepKey="hoverOverSwatchAttribute"/> |
| 129 | + <waitForPageLoad stepKey="waitForHoveredImageToLoad"/> |
| 130 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchThumbnailsImgLayeredNav('swatch_thumb')}}" stepKey="seeSwatchImageOnHover"/> |
| 131 | + <moveMouseOver selector="{{StorefrontMinicartSection.showCart}}" stepKey="moveAwayFromLayeredNav1"/> |
| 132 | + <click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createTextSwatchAttribute.frontend_label[0]$')}}" stepKey="expandTextSwatchAttribute"/> |
| 133 | + <moveMouseOver selector="{{StorefrontCategorySidebarSection.swatchTextLayeredNav('${grabTextValue}')}}" stepKey="hoverOverTextAttribute"/> |
| 134 | + <waitForPageLoad stepKey="waitForHoveredTextToLoad"/> |
| 135 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchTextLayeredNavHover('${grabTextValue}')}}" stepKey="seeSwatchTextOnHover"/> |
| 136 | + <moveMouseOver selector="{{StorefrontMinicartSection.showCart}}" stepKey="moveAwayFromLayeredNav2"/> |
| 137 | + <!-- Verify the swatches on displayed product --> |
| 138 | + <click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createVisualSwatchAttribute.frontend_label[0]$')}}" stepKey="expandVisualSwatchAttributeToClick"/> |
| 139 | + <click selector="{{StorefrontCategorySidebarSection.expandedSwatchThumbnails('$createVisualSwatchAttribute.frontend_label[0]$','swatch-option')}}" stepKey="clickOverSwatchAttribute"/> |
| 140 | + <waitForPageLoad stepKey="waitForSwatchImageFilteredProductToLoad"/> |
| 141 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchSelectedInFilteredProd('image')}}" stepKey="seeSwatchImageOnFilteredProduct"/> |
| 142 | + <moveMouseOver selector="{{StorefrontCategorySidebarSection.swatchSelectedInFilteredProd('image')}}" stepKey="hoverOverSwatchImageOnFilteredProduct"/> |
| 143 | + <waitForPageLoad stepKey="waitForHoveredImageToLoadForFilteredProduct"/> |
| 144 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchThumbnailsImgLayeredNav('swatch_thumb')}}" stepKey="seeSwatchImageOnFilteredProductHover"/> |
| 145 | + <moveMouseOver selector="{{StorefrontMinicartSection.showCart}}" stepKey="moveAwayFromLayeredNav3"/> |
| 146 | + <click selector="{{StorefrontCategorySidebarSection.removeFilter}}" stepKey="removeFilter"/> |
| 147 | + <click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createTextSwatchAttribute.frontend_label[0]$')}}" stepKey="expandTextSwatchAttributeToClick"/> |
| 148 | + <click selector="{{StorefrontCategorySidebarSection.expandedSwatchThumbnails('$createTextSwatchAttribute.frontend_label[0]$','swatch-option')}}" stepKey="clickOverTextAttribute"/> |
| 149 | + <waitForPageLoad stepKey="waitForSwatchTextFilteredProductToLoad"/> |
| 150 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchSelectedInFilteredProd('text')}}" stepKey="seeSwatchTextOnFilteredProduct"/> |
| 151 | + <moveMouseOver selector="{{StorefrontCategorySidebarSection.swatchSelectedInFilteredProd('text')}}" stepKey="hoverOverSwatchTextOnFilteredProduct"/> |
| 152 | + <waitForPageLoad stepKey="waitForHoveredTextToLoadForFilteredProduct"/> |
| 153 | + <seeElement selector="{{StorefrontCategorySidebarSection.swatchTextFilteredProdHover('${grabTextValue}')}}" stepKey="seeSwatchTextOnFilteredProductHover"/> |
| 154 | + </test> |
| 155 | +</tests> |
0 commit comments