Skip to content

Commit 2e67007

Browse files
Manoranjan.PrakashManoranjan.Prakash
authored andcommitted
ACQE-4425: SwatchesAreVisibleInLayeredNavigationTest
implementing code review- placed the elements in correct swatch folder
1 parent ffb95ff commit 2e67007

File tree

3 files changed

+12
-30
lines changed

3 files changed

+12
-30
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,5 @@
2727
<element name="expandPriceLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Price']"/>
2828
<element name="seeLayeredNavigationFirstPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice}}']/..//span[@class='price' and text()='${{maxPrice}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
2929
<element name="seeLayeredNavigationSecondPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice2}}']/../..//a[text()='{{maxPrice2}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
30-
<element name="expandedSwatchThumbnails" type="block" selector="//div[@aria-expanded='true' and contains(text(),'{{attribute_code}}')]/..//div[contains(@class,'{{swatch_types}}')]" parameterized="true"/>
31-
<element name="swatchThumbnailsImgLayeredNav" type="block" selector="//div[@class='image' and contains(@style,'{{swatch_thumb}}')]" parameterized="true"/>
32-
<element name="swatchTextLayeredNav" type="block" selector="//div[@class='swatch-option text ' and @data-option-label='{{args}}']" parameterized="true"/>
33-
<element name="swatchTextLayeredNavHover" type="block" selector="//div[@class='title' and text()='{{args}}']" parameterized="true"/>
34-
<element name="swatchSelectedInFilteredProd" type="block" selector="//div[@class='swatch-option {{args}} selected']" parameterized="true"/>
35-
<element name="swatchTextFilteredProdHover" type="block" selector="//div[@class='swatch-option-tooltip']//div[@class='title' and contains(text(),'{{args}}')]" parameterized="true"/>
3630
</section>
3731
</sections>

app/code/Magento/Swatches/Test/Mftf/Section/StorefrontCategorySidebarSection.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@
1111
<element name="layeredFilterBlock" type="block" selector="#layered-filter-block"/>
1212
<element name="filterOptionTitle" type="button" selector="//div[@class='filter-options-title'][text() = '{{var}}']" parameterized="true" timeout="30"/>
1313
<element name="attributeNthOption" type="button" selector="div.{{attributeLabel}} a:nth-of-type({{n}}) div" parameterized="true" timeout="30"/>
14+
<element name="expandedSwatchThumbnails" type="block" selector="//div[@aria-expanded='true' and contains(text(),'{{attribute_code}}')]/..//div[contains(@class,'{{swatch_types}}')]" parameterized="true"/>
15+
<element name="swatchThumbnailsImgLayeredNav" type="block" selector="//div[@class='image' and contains(@style,'{{swatch_thumb}}')]" parameterized="true"/>
16+
<element name="swatchTextLayeredNav" type="block" selector="//div[@class='swatch-option text ' and @data-option-label='{{args}}']" parameterized="true"/>
17+
<element name="swatchTextLayeredNavHover" type="block" selector="//div[@class='title' and text()='{{args}}']" parameterized="true"/>
18+
<element name="swatchSelectedInFilteredProd" type="block" selector="//div[@class='swatch-option {{args}} selected']" parameterized="true"/>
19+
<element name="swatchTextFilteredProdHover" type="block" selector="//div[@class='swatch-option-tooltip']//div[@class='title' and contains(text(),'{{args}}')]" parameterized="true"/>
1420
</section>
15-
</sections>
21+
</sections>

app/code/Magento/Swatches/Test/Mftf/Test/SwatchesAreVisibleInLayeredNavigationTest.xml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,68 +29,56 @@
2929
<deleteData createDataKey="createVisualSwatchAttribute" stepKey="deleteVisualSwatchAttribute"/>
3030
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
3131
</after>
32-
3332
<!-- Create 2 Configurable products -->
3433
<createData entity="_defaultCategory" stepKey="createCategory" />
3534
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct1">
3635
<requiredEntity createDataKey="createCategory"/>
3736
</createData>
38-
3937
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct2">
4038
<requiredEntity createDataKey="createCategory"/>
4139
</createData>
42-
4340
<!-- Create product visual swatch attribute -->
4441
<createData entity="VisualSwatchProductAttributeForm" stepKey="createVisualSwatchAttribute"/>
4542
<createData entity="SwatchProductAttributeOption1" stepKey="visualSwatchAttributeOption">
4643
<requiredEntity createDataKey="createVisualSwatchAttribute"/>
4744
</createData>
48-
4945
<!-- Create product text swatch attribute -->
5046
<createData entity="TextSwatchProductAttributeForm" stepKey="createTextSwatchAttribute"/>
5147
<createData entity="SwatchProductAttributeOption1" stepKey="textSwatchAttributeOption">
5248
<requiredEntity createDataKey="createTextSwatchAttribute"/>
5349
</createData>
54-
55-
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
56-
<magentoCLI stepKey="flushCache" command="cache:flush"/>
57-
50+
<magentoCLI stepKey="reindexPostCreating2Attributes" command="indexer:reindex"/>
51+
<magentoCLI stepKey="flushCachePostCreating2Attributes" command="cache:flush"/>
5852
<!-- Go to the edit page for the visual Swatch attribute -->
59-
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributesToEditvisualSwatchAttribute"/>
60-
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillFilterToEditvisualSwatchAttribute"/>
61-
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchToEditvisualSwatchAttribute"/>
53+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributesToEditVisualSwatchAttribute"/>
54+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillFilterToEditVisualSwatchAttribute"/>
55+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchToEditVisualSwatchAttribute"/>
6256
<click selector="{{AdminProductAttributeGridSection.AttributeCode('$createVisualSwatchAttribute.attribute_code$')}}" stepKey="clickVisualSwatchRowToEdit"/>
63-
6457
<click selector="{{AdminManageSwatchSection.swatchWindowEdit('1')}}" stepKey="clickSwatchButtonToEdit"/>
6558
<click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/>
6659
<attachFile selector="input[name='datafile']" userInput="adobe-thumb.jpg" stepKey="attachFile1"/>
6760
<waitForPageLoad stepKey="waitFileAttached1"/>
6861
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEditForVisualSwatchAttribute"/>
6962
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessForVisualSwatchAttribute"/>
70-
7163
<!-- Go to the edit page for the text Swatch attribute -->
7264
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributesToEditTextSwatchAttribute"/>
7365
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="$createTextSwatchAttribute.attribute_code$" stepKey="fillFilterToEditTextSwatchAttribute"/>
7466
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchToEditTextSwatchAttribute"/>
7567
<click selector="{{AdminProductAttributeGridSection.AttributeCode('$createTextSwatchAttribute.attribute_code$')}}" stepKey="clickTextSwatchRowToEdit"/>
76-
7768
<fillField selector="{{AdminManageSwatchSection.updateSwatchText('1')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionAdminName"/>
7869
<fillField selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('1')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDescription"/>
7970
<fillField selector="{{AdminManageSwatchSection.updateSwatchText('2')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDefaultStoreViewName"/>
8071
<fillField selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('2')}}" userInput="{{textSwatch1.name}}" stepKey="fillFirstOptionDefaultStoreViewDescription"/>
8172
<grabValueFrom selector="{{AdminManageSwatchSection.updateDescriptionSwatchText('2')}}" stepKey="grabTextValue"/>
82-
8373
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEditForTextSwatchAttribute"/>
8474
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessForTextSwatchAttribute"/>
85-
8675
<!-- Update Config product1 visual swatch attribute -->
8776
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigurableProduct1">
8877
<argument name="product" value="$$createConfigurableProduct1$$"/>
8978
</actionGroup>
9079
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductForConfigurableProduct1">
9180
<argument name="product" value="$$createConfigurableProduct1$$"/>
9281
</actionGroup>
93-
9482
<!-- Edit the configurable product 1 -->
9583
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnTheCreateConfigurationsButtonForConfigProd1"/>
9684
<waitForPageLoad time="30" stepKey="waitForPageLoadForConfigProd1"/>
@@ -107,15 +95,13 @@
10795
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductForConfigProd1"/>
10896
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProductForConfigProd1"/>
10997
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessageForConfigProd1"/>
110-
11198
<!-- Update Config product2 visual swatch attribute -->
11299
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForConfigurableProduct2">
113100
<argument name="product" value="$$createConfigurableProduct2$$"/>
114101
</actionGroup>
115102
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductForConfigurableProduct2">
116103
<argument name="product" value="$$createConfigurableProduct2$$"/>
117104
</actionGroup>
118-
119105
<!-- Edit the configurable product 2 -->
120106
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnTheCreateConfigurationsButtonForConfigProd2"/>
121107
<waitForPageLoad time="30" stepKey="waitForPageLoadForConfigProd2"/>
@@ -132,15 +118,12 @@
132118
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveConfigurableProductForConfigProd2"/>
133119
<conditionalClick selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" dependentSelector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" visible="true" stepKey="confirmDefaultAttributeSetForConfigurableProductForConfigProd2"/>
134120
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="checkProductSavedMessageForConfigProd2"/>
135-
136121
<!-- Go to the Storefront category page -->
137122
<amOnPage url="$$createCategory.custom_attributes[url_key]$$.html" stepKey="amOnCategoryPage"/>
138123
<waitForPageLoad stepKey="waitForCategoryPage"/>
139-
140124
<!-- Verify swatches are present in the layered navigation -->
141125
<see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="$createVisualSwatchAttribute.frontend_label[0]$" stepKey="seeVisualSwatchAttributeInLayeredNav"/>
142126
<see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="$createTextSwatchAttribute.frontend_label[0]$" stepKey="seeTextSwatchAttributeInLayeredNav"/>
143-
144127
<click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createVisualSwatchAttribute.frontend_label[0]$')}}" stepKey="expandVisualSwatchAttribute"/>
145128
<moveMouseOver selector="{{StorefrontCategorySidebarSection.expandedSwatchThumbnails('$createVisualSwatchAttribute.frontend_label[0]$','swatch-option')}}" stepKey="hoverOverSwatchAttribute"/>
146129
<waitForPageLoad stepKey="waitForHoveredImageToLoad"/>
@@ -151,7 +134,6 @@
151134
<waitForPageLoad stepKey="waitForHoveredTextToLoad"/>
152135
<seeElement selector="{{StorefrontCategorySidebarSection.swatchTextLayeredNavHover('${grabTextValue}')}}" stepKey="seeSwatchTextOnHover"/>
153136
<moveMouseOver selector="{{StorefrontMinicartSection.showCart}}" stepKey="moveAwayFromLayeredNav2"/>
154-
155137
<!-- Verify the swatches on displayed product -->
156138
<click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$createVisualSwatchAttribute.frontend_label[0]$')}}" stepKey="expandVisualSwatchAttributeToClick"/>
157139
<click selector="{{StorefrontCategorySidebarSection.expandedSwatchThumbnails('$createVisualSwatchAttribute.frontend_label[0]$','swatch-option')}}" stepKey="clickOverSwatchAttribute"/>

0 commit comments

Comments
 (0)