Skip to content

Commit 47c30fd

Browse files
ACQE-9003: Image is taken from configurable product if images are not specified with the selected swatches
- Created visual and text swatch attributes with options via entity, updated steps comments
1 parent 16f51ec commit 47c30fd

File tree

4 files changed

+132
-130
lines changed

4 files changed

+132
-130
lines changed

app/code/Magento/Swatches/Test/Mftf/Data/SwatchAttributeData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@
5555
<data key="frontend_input">swatch_text</data>
5656
<data key="attribute_code" unique="suffix">text_swatch_attribute_</data>
5757
</entity>
58+
<entity name="VisualSwatchProductAttributeFormWithImageFallback" extends="VisualSwatchProductAttributeForm">
59+
<data key="use_product_image_for_swatch">1</data>
60+
</entity>
5861
</entities>

app/code/Magento/Swatches/Test/Mftf/Data/SwatchAttributeOptionData.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,61 @@
3232
<requiredEntity type="StoreLabel">Option3Store0</requiredEntity>
3333
<requiredEntity type="StoreLabel">Option3Store1</requiredEntity>
3434
</entity>
35+
<!-- Visual Swatch Options: A, B, C -->
36+
<entity name="VisualSwatchOptionA" type="ProductSwatchAttributeOption">
37+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
38+
<data key="label">A</data>
39+
<data key="is_default">false</data>
40+
<data key="sort_order">0</data>
41+
</entity>
42+
<entity name="VisualSwatchOptionB" type="ProductSwatchAttributeOption">
43+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
44+
<data key="label">B</data>
45+
<data key="is_default">false</data>
46+
<data key="sort_order">1</data>
47+
</entity>
48+
<entity name="VisualSwatchOptionC" type="ProductSwatchAttributeOption">
49+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
50+
<data key="label">C</data>
51+
<data key="is_default">false</data>
52+
<data key="sort_order">2</data>
53+
</entity>
54+
<!-- Text Swatch Attribute 1 Options: 1, 2, 3 -->
55+
<entity name="TextSwatchOption1" type="ProductSwatchAttributeOption">
56+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
57+
<data key="label">1</data>
58+
<data key="is_default">false</data>
59+
<data key="sort_order">0</data>
60+
</entity>
61+
<entity name="TextSwatchOption2" type="ProductSwatchAttributeOption">
62+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
63+
<data key="label">2</data>
64+
<data key="is_default">false</data>
65+
<data key="sort_order">1</data>
66+
</entity>
67+
<entity name="TextSwatchOption3" type="ProductSwatchAttributeOption">
68+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
69+
<data key="label">3</data>
70+
<data key="is_default">false</data>
71+
<data key="sort_order">2</data>
72+
</entity>
73+
<!-- Text Swatch Attribute 2 Options: X, Y, Z -->
74+
<entity name="TextSwatchOptionX" type="ProductSwatchAttributeOption">
75+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
76+
<data key="label">X</data>
77+
<data key="is_default">false</data>
78+
<data key="sort_order">0</data>
79+
</entity>
80+
<entity name="TextSwatchOptionY" type="ProductSwatchAttributeOption">
81+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
82+
<data key="label">Y</data>
83+
<data key="is_default">false</data>
84+
<data key="sort_order">1</data>
85+
</entity>
86+
<entity name="TextSwatchOptionZ" type="ProductSwatchAttributeOption">
87+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
88+
<data key="label">Z</data>
89+
<data key="is_default">false</data>
90+
<data key="sort_order">2</data>
91+
</entity>
3592
</entities>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategorySwatchSection">
1212
<element name="swatchOptionByLabel" type="button" selector=".products-grid .swatch-option[data-option-label='{{label}}']" parameterized="true"/>
1313
<element name="productImageInGrid" type="block" selector=".products-grid .product-item-photo img"/>

0 commit comments

Comments
 (0)