Skip to content

Commit a680440

Browse files
committed
ACQE-8844: Configurable product image display with multiple swatches on catalog, product page, and layered navigation
- Used sentence case and added waitForElementClickable
1 parent 9d060cf commit a680440

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<features value="Swatches"/>
1414
<stories value="Configurable product with multiple swatch attributes"/>
1515
<title value="Configurable product image display with multiple swatches on catalog, product page, and layered navigation"/>
16-
<description value="Create configurable product with 3 swatch attributes (1 visual A/B/C, 2 text 1/2/3 and X/Y/Z) and verify image display on catalog page, product page with gallery, and layered navigation filtering"/>
16+
<description value="Verify configurable product image display with multiple swatch attributes on catalog, product, and layered navigation pages"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="AC-5545"/>
1919
<group value="swatches"/>
@@ -32,7 +32,7 @@
3232
<createData entity="VisualSwatchOptionC" stepKey="swatchAttributeThirdOption">
3333
<requiredEntity createDataKey="createVisualSwatchAttribute"/>
3434
</createData>
35-
<!-- Create Text Swatch Attribute 1 with 3 options -->
35+
<!-- Create text swatch attribute 1 with 3 options -->
3636
<createData entity="TextSwatchProductAttributeForm" stepKey="createTextSwatchAttribute1"/>
3737
<createData entity="TextSwatchOption1" stepKey="textSwatchAttribute1FirstOption">
3838
<requiredEntity createDataKey="createTextSwatchAttribute1"/>
@@ -43,7 +43,7 @@
4343
<createData entity="TextSwatchOption3" stepKey="textSwatchAttribute1ThirdOption">
4444
<requiredEntity createDataKey="createTextSwatchAttribute1"/>
4545
</createData>
46-
<!-- Create Text Swatch Attribute 2 with 3 options -->
46+
<!-- Create text swatch attribute 2 with 3 options -->
4747
<createData entity="TextSwatchProductAttributeForm" stepKey="createTextSwatchAttribute2"/>
4848
<createData entity="TextSwatchOptionX" stepKey="textSwatchAttribute2FirstOption">
4949
<requiredEntity createDataKey="createTextSwatchAttribute2"/>
@@ -54,7 +54,7 @@
5454
<createData entity="TextSwatchOptionZ" stepKey="textSwatchAttribute2ThirdOption">
5555
<requiredEntity createDataKey="createTextSwatchAttribute2"/>
5656
</createData>
57-
<!-- Step 2: Create Configurable Product -->
57+
<!-- Step 2: Create configurable product -->
5858
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
5959
<requiredEntity createDataKey="createCategory"/>
6060
</createData>
@@ -68,53 +68,64 @@
6868
<argument name="image" value="MagentoLogo"/>
6969
</actionGroup>
7070
<!-- Generate configurations for the 3 attributes -->
71+
<waitForElementClickable selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="waitForCreateConfigurationsClickable"/>
7172
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
7273
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="waitForConfigurationModal"/>
7374
<!-- Select all 3 attributes -->
75+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createVisualSwatchAttribute.attribute_code$$)}}" stepKey="waitForVisualSwatchAttrClickable"/>
7476
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createVisualSwatchAttribute.attribute_code$$)}}" stepKey="selectVisualSwatchAttr"/>
77+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createTextSwatchAttribute1.attribute_code$$)}}" stepKey="waitForTextSwatchAttr1Clickable"/>
7578
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createTextSwatchAttribute1.attribute_code$$)}}" stepKey="selectTextSwatchAttr1"/>
79+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createTextSwatchAttribute2.attribute_code$$)}}" stepKey="waitForTextSwatchAttr2Clickable"/>
7680
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($$createTextSwatchAttribute2.attribute_code$$)}}" stepKey="selectTextSwatchAttr2"/>
81+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextToSelectOptionsClickable"/>
7782
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/>
7883
<waitForPageLoad stepKey="waitForOptionsPage"/>
7984
<!-- Select all options for all attributes -->
85+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createVisualSwatchAttribute.frontend_label[0]$$)}}" stepKey="waitForSelectAllVisualClickable"/>
8086
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createVisualSwatchAttribute.frontend_label[0]$$)}}" stepKey="selectAllVisualOptions"/>
87+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createTextSwatchAttribute1.frontend_label[0]$$)}}" stepKey="waitForSelectAllText1Clickable"/>
8188
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createTextSwatchAttribute1.frontend_label[0]$$)}}" stepKey="selectAllText1Options"/>
89+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createTextSwatchAttribute2.frontend_label[0]$$)}}" stepKey="waitForSelectAllText2Clickable"/>
8290
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute($$createTextSwatchAttribute2.frontend_label[0]$$)}}" stepKey="selectAllText2Options"/>
91+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextToImagesClickable"/>
8392
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToImages"/>
8493
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="waitForImagesSection"/>
8594
<!-- Add images to simple products -->
95+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="waitForApplyUniqueImagesClickable"/>
8696
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickApplyUniqueImages"/>
8797
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" userInput="$$createVisualSwatchAttribute.frontend_label[0]$$" stepKey="selectAttributeForImages"/>
8898
<waitForPageLoad stepKey="waitForImageUploadSectionsToLoad"/>
8999
<!-- Upload image for option A -->
90100
<attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(VisualSwatchOptionA.label)}}" userInput="{{TestImageAdobe.file}}" stepKey="uploadImageForA"/>
91-
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForImageUploadA"/>
92101
<!-- Upload image for option B -->
93102
<attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(VisualSwatchOptionB.label)}}" userInput="{{AdobeSmallImage.file}}" stepKey="uploadImageForB"/>
94-
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForImageUploadB"/>
95103
<!-- Upload image for option C -->
96104
<attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(VisualSwatchOptionC.label)}}" userInput="{{AdobeThumbImage.file}}" stepKey="uploadImageForC"/>
97-
<waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForImageUploadC"/>
98105
<!-- Apply single price -->
99106
<scrollTo selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="scrollToApplyPrice"/>
107+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="waitForApplySinglePriceClickable"/>
100108
<click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickApplySinglePrice"/>
101109
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" stepKey="waitForPriceField"/>
102110
<fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="50" stepKey="enterPrice"/>
103111
<!-- Apply single quantity -->
104112
<scrollTo selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="scrollToApplyQuantity"/>
113+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitForApplySingleQuantityClickable"/>
105114
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickApplySingleQuantity"/>
106115
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.quantity}}" stepKey="waitForQuantityField"/>
107116
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterQuantity"/>
117+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextToSummaryClickable"/>
108118
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSummary"/>
109119
<!-- Generate products -->
120+
<waitForElementClickable selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForGenerateProductsClickable"/>
110121
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickGenerateProducts"/>
111122
<waitForPageLoad stepKey="waitForConfigurationsGenerated"/>
112123
<!-- Save product -->
113124
<actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveConfigProduct"/>
114125
</before>
115126
<after>
116127
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
117-
<!-- Delete configurable product & its variants via API using ProductApiHelper -->
128+
<!-- Delete configurable product & its variants -->
118129
<helper class="Magento\Catalog\Test\Mftf\Helper\ProductApiHelper" method="deleteAllProductsApi" stepKey="deleteAllProductsViaApi"/>
119130
<!-- Delete attributes -->
120131
<deleteData createDataKey="createVisualSwatchAttribute" stepKey="deleteVisualSwatchAttribute"/>
@@ -129,6 +140,7 @@
129140
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
130141
<waitForElementVisible selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="waitForProductsVisible"/>
131142
<!-- Step 4: Select A-2-Y options -->
143+
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(VisualSwatchOptionA.label)}}" stepKey="waitForOptionAClickable"/>
132144
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(VisualSwatchOptionA.label)}}" stepKey="selectOptionA"/>
133145
<waitForPageLoad stepKey="waitAfterSelectA"/>
134146
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOption2.label)}}" stepKey="selectOption2"/>
@@ -142,15 +154,16 @@
142154
<waitForPageLoad stepKey="waitAfterSelectZ"/>
143155
<!-- Expected Result: Base image of the A-2-Z product is displayed -->
144156
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productImage}}" stepKey="verifyImageDisplayedForA2Z"/>
145-
<!-- Step 6: Open Product page -->
157+
<!-- Step 6: Open product page -->
146158
<click selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo('$$createConfigProduct.name$$')}}" stepKey="openProductPage"/>
147159
<waitForPageLoad stepKey="waitForProductPage"/>
148160
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="waitForProductName"/>
149161
<!-- Step 7: Select A-2-Y options -->
162+
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(VisualSwatchOptionA.label)}}" stepKey="waitForOptionAClickableOnProductPage"/>
150163
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(VisualSwatchOptionA.label)}}" stepKey="selectOptionAOnProductPage"/>
151-
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOption2.label)}}" stepKey="waitForTextSwatchesVisible"/>
164+
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOption2.label)}}" stepKey="waitForTextSwatchesVisibleOnProductPage"/>
152165
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOption2.label)}}" stepKey="selectOption2OnProductPage"/>
153-
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOptionY.label)}}" stepKey="waitForThirdSwatchVisible"/>
166+
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOptionY.label)}}" stepKey="waitForThirdSwatchVisibleOnProductPage"/>
154167
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(TextSwatchOptionY.label)}}" stepKey="selectOptionYOnProductPage"/>
155168
<waitForPageLoad stepKey="waitAfterSelectYOnProductPage"/>
156169
<!-- Expected Result: Base image of the A-2-Y product is displayed. All images of this product are displayed in roundabout -->
@@ -168,6 +181,7 @@
168181
</actionGroup>
169182
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" stepKey="waitForLayeredNavigation"/>
170183
<!-- Step 10: Select A-2-Y options -->
184+
<waitForElementClickable selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$$createVisualSwatchAttribute.frontend_label[0]$$')}}" stepKey="waitForVisualSwatchFilterClickable"/>
171185
<click selector="{{StorefrontCategorySidebarSection.filterOptionTitle('$$createVisualSwatchAttribute.frontend_label[0]$$')}}" stepKey="expandVisualSwatchFilter"/>
172186
<waitForPageLoad stepKey="waitAfterExpandVisualFilter"/>
173187
<click selector="{{StorefrontCategorySidebarSection.swatchVisualLayeredNav(VisualSwatchOptionA.label)}}" stepKey="selectAInLayeredNav"/>

0 commit comments

Comments
 (0)