Skip to content

Commit 980badb

Browse files
Pradyumna BhatPradyumna Bhat
authored andcommitted
ACQE-7462: Display images for a configurable product on store front
PR review comment fixes
1 parent 9dc7d37 commit 980badb

10 files changed

+62
-83
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToColorAttributeActionGroup.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAddOptionsToDropdownAttributeActionGroup">
12+
<annotations>
13+
<description>Adds options to a product attribute of type "dropdown" in the Admin panel.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionIndex" type="string" defaultValue="0"/>
17+
<argument name="optionValue" type="string"/>
18+
</arguments>
19+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickOnAddOption"/>
20+
<waitForElementVisible selector="{{AdminNewAttributePanel.optionAdminValue(optionIndex)}}" stepKey="waitForAdminLabel"/>
21+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue(optionIndex)}}" userInput="{{optionValue}}" stepKey="fillAdminLabel"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminRemoveOptionsFromColorAttributeActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminUnassignAttributeFromDefaultSetActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateCustomAttributeActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontVerifyConfigurableProductImagesActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/CategoryData.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,19 @@
123123
<data key="name">API Configurable Export Import Product</data>
124124
<data key="urlKey">api-configurable-export-import-product</data>
125125
</entity>
126+
<entity name="ConfigurableProduct1" type="product">
127+
<data key="name" unique="suffix">conf1</data>
128+
<data key="sku" unique="suffix">conf1</data>
129+
<data key="type_id">configurable</data>
130+
<data key="attribute_set_id">4</data>
131+
<data key="status">1</data>
132+
<data key="quantity">10000</data>
133+
<data key="price">10</data>
134+
<data key="color_label">Color</data>
135+
<data key="size_label">Size</data>
136+
<data key="color_option1">black</data>
137+
<data key="color_option2">red</data>
138+
<data key="size_option1">8</data>
139+
<data key="size_option2">10</data>
140+
</entity>
126141
</entities>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ProductData.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductUniqueImageDisplayTest.xml renamed to app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductUniqueImageDisplayTest.xml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->
8-
98
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="ConfigurableProductUniqueImageDisplayTest">
10+
<test name="StorefrontConfigurableProductUniqueImageDisplayTest">
1211
<annotations>
1312
<features value="Backend"/>
1413
<stories value="Display unique images for a configurable product on storefront"/>
1514
<title value="Unique images should be displayed on storefront correctly for Configurable product"/>
1615
<description value="Admin should be able to add images for configurable products and unique images should display on storefront correctly based configurable attribute options"/>
1716
<severity value="MAJOR"/>
18-
<testCaseId value="MC-27546"/>
17+
<testCaseId value="AC-4825"/>
1918
<group value="catalog"/>
2019
</annotations>
2120
<before>
@@ -26,9 +25,18 @@
2625
<actionGroup ref="AdminNavigateToProductAttributeEditPageActionGroup" stepKey="navigateToColorProductAttribute1">
2726
<argument name="ProductAttributeLabel" value="Color"/>
2827
</actionGroup>
29-
30-
<!-- Use action group to add options for color attribute-->
31-
<actionGroup ref="AdminAddOptionsToColorAttributeActionGroup" stepKey="addOptionsForColorAttribute"/>
28+
<!-- Use the action group to add the 'black' option to the Color attribute -->
29+
<actionGroup ref="AdminAddOptionsToDropdownAttributeActionGroup" stepKey="addOptionBlackForColorAttribute">
30+
<argument name="optionIndex" value="0"/>
31+
<argument name="optionValue" value="{{ConfigurableProduct1.color_option1}}"/>
32+
</actionGroup>
33+
<!-- Use the action group to add the 'red' option to the Color attribute -->
34+
<actionGroup ref="AdminAddOptionsToDropdownAttributeActionGroup" stepKey="addOptionRedForColorAttribute">
35+
<argument name="optionIndex" value="1"/>
36+
<argument name="optionValue" value="{{ConfigurableProduct1.color_option2}}"/>
37+
</actionGroup>
38+
<!-- Save attribute -->
39+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveColorAttribute"/>
3240

3341
<!-- Create new attribute 'Size'-->
3442
<actionGroup ref="CreateCustomAttributeActionGroup" stepKey="createCustomProductAttributeSize">
@@ -45,13 +53,13 @@
4553
<!--Crete new category-->
4654
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
4755
<actionGroup ref="CreateCategoryActionGroup" stepKey="createNewSubcategory">
48-
<argument name="categoryEntity" value="CategoryNew1"/>
56+
<argument name="categoryEntity" value="CategoryB"/>
4957
</actionGroup>
5058
</before>
5159
<after>
5260
<!--Delete category-->
5361
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteSubcategory">
54-
<argument name="categoryEntity" value="CategoryNew1"/>
62+
<argument name="categoryEntity" value="CategoryB"/>
5563
</actionGroup>
5664

5765
<!-- Delete product -->
@@ -90,7 +98,7 @@
9098
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{ConfigurableProduct1.name}}" stepKey="fillProductName"/>
9199
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{ConfigurableProduct1.sku}}" stepKey="fillProductSku"/>
92100
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{ConfigurableProduct1.price}}" stepKey="fillProductPrice"/>
93-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{CategoryNew1.name}}]" stepKey="selectCategory"/>
101+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{CategoryB.name}}]" stepKey="selectCategory"/>
94102
<!-- Setup configurations-->
95103
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/>
96104
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/>
@@ -138,9 +146,9 @@
138146

139147
<!-- Verify on storefront that category and product is visible -->
140148
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryStorefrontPage">
141-
<argument name="categoryUrl" value="{{CategoryNew1.urlKey}}"/>
149+
<argument name="categoryUrl" value="{{CategoryB.urlKey}}"/>
142150
</actionGroup>
143-
<waitForText userInput="{{CategoryNew1.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryNameOnStorefront"/>
151+
<waitForText userInput="{{CategoryB.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryNameOnStorefront"/>
144152
<waitForText userInput="{{ConfigurableProduct1.name}}" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="assertProductVisibleInStorefront"/>
145153

146154
<!-- Navigate to Product Page -->

0 commit comments

Comments
 (0)