Skip to content

Commit b31810a

Browse files
ManjushaManjusha
authored andcommitted
Merge branch 'ACQE-4425' into functional-testing-mainline-deployment
2 parents a14f188 + 7ba9b19 commit b31810a

File tree

3 files changed

+165
-1
lines changed

3 files changed

+165
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
<element name="nthDelete" type="button" selector="#swatch-visual-options-panel table tbody tr:nth-of-type({{var}}) button.delete-option" parameterized="true"/>
3232
<element name="deleteBtn" type="button" selector="#manage-options-panel:nth-of-type({{var}}) button.delete-option" parameterized="true"/>
3333
<element name="manageSwatchSection" type="block" selector='//legend/span[contains(text(),"Manage Swatch (Values of Your Attribute)")]'/>
34+
<element name="updateSwatchText" type="input" selector="//td[contains(@class,'col-swatch col-swatch-min-width')][{{index}}]//input" parameterized="true"/>
35+
<element name="updateDescriptionSwatchText" type="input" selector="//td[contains(@class,'col-swatch-min-width swatch-col')][{{index}}]//input[@placeholder='Description']" parameterized="true"/>
36+
<element name="swatchWindowEdit" type="button" selector="//div[@class='swatch_window'][{{args}}]/.." parameterized="true"/>
3437
</section>
3538
</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>
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
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

Comments
 (0)