Skip to content

Commit 40d14e4

Browse files
committed
ACQE:8577: Validate price changes for configurable product with dropdown and text swatch attributes displayed in widget
- Removed unwanted data entities
1 parent 7806da7 commit 40d14e4

File tree

3 files changed

+76
-143
lines changed

3 files changed

+76
-143
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/FrontendLabelData.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,4 @@
2424
<data key="store_id">0</data>
2525
<data key="label">attributeExportImport</data>
2626
</entity>
27-
<entity name="DropdownSizeFrontendLabel" type="FrontendLabel">
28-
<data key="store_id">0</data>
29-
<data key="label">my size</data>
30-
</entity>
31-
<entity name="TextSwatchColorFrontendLabel" type="FrontendLabel">
32-
<data key="store_id">0</data>
33-
<data key="label">color1</data>
34-
</entity>
3527
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -492,110 +492,5 @@
492492
<data key="option2">2</data>
493493
<data key="option3">3</data>
494494
</entity>
495-
<!-- Dropdown Size Attribute -->
496-
<entity name="DropdownSizeAttributeData" type="ProductAttribute">
497-
<data key="attribute_code">my_size</data>
498-
<data key="attribute_type">Dropdown</data>
499-
<data key="frontend_input">select</data>
500-
<data key="scope">global</data>
501-
<data key="is_required">false</data>
502-
<data key="is_unique">false</data>
503-
<data key="is_searchable">true</data>
504-
<data key="is_visible">true</data>
505-
<data key="is_visible_in_advanced_search">true</data>
506-
<data key="is_visible_on_front">true</data>
507-
<data key="is_filterable">true</data>
508-
<data key="is_filterable_in_search">true</data>
509-
<data key="used_in_product_listing">true</data>
510-
<data key="is_used_for_promo_rules">true</data>
511-
<data key="is_comparable">true</data>
512-
<data key="is_used_in_grid">true</data>
513-
<data key="is_visible_in_grid">true</data>
514-
<data key="is_filterable_in_grid">true</data>
515-
<data key="used_for_sort_by">true</data>
516-
<requiredEntity type="FrontendLabel">DropdownSizeFrontendLabel</requiredEntity>
517-
</entity>
518-
<!-- Text Swatch Color Attribute -->
519-
<entity name="TextSwatchColorAttributeData" type="ProductAttribute">
520-
<data key="attribute_code">color_swatch</data>
521-
<data key="attribute_type">swatch_text</data>
522-
<data key="frontend_input">swatch_text</data>
523-
<data key="scope">global</data>
524-
<data key="is_required">false</data>
525-
<data key="is_unique">false</data>
526-
<data key="is_searchable">true</data>
527-
<data key="is_visible">true</data>
528-
<data key="is_visible_in_advanced_search">true</data>
529-
<data key="is_visible_on_front">true</data>
530-
<data key="is_filterable">true</data>
531-
<data key="is_filterable_in_search">true</data>
532-
<data key="used_in_product_listing">true</data>
533-
<data key="is_used_for_promo_rules">true</data>
534-
<data key="is_comparable">true</data>
535-
<data key="is_used_in_grid">true</data>
536-
<data key="is_visible_in_grid">true</data>
537-
<data key="is_filterable_in_grid">true</data>
538-
<data key="used_for_sort_by">true</data>
539-
<requiredEntity type="FrontendLabel">TextSwatchColorFrontendLabel</requiredEntity>
540-
</entity>
541-
<!-- Size Options -->
542-
<entity name="AttributeOptionSmall" type="option">
543-
<data key="value">Small</data>
544-
</entity>
545-
<entity name="AttributeOptionLarge" type="option">
546-
<data key="value">Large</data>
547-
</entity>
548-
<!-- Size Product Attribute Options for API -->
549-
<entity name="DropdownSizeOptionSmall" type="ProductAttributeOption">
550-
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
551-
<data key="label">Small</data>
552-
<data key="is_default">false</data>
553-
<data key="sort_order">0</data>
554-
</entity>
555-
<entity name="DropdownSizeOptionLarge" type="ProductAttributeOption">
556-
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
557-
<data key="label">Large</data>
558-
<data key="is_default">false</data>
559-
<data key="sort_order">1</data>
560-
</entity>
561-
<!-- Color Options -->
562-
<entity name="AttributeOptionBlack" type="option">
563-
<data key="value">Black</data>
564-
</entity>
565-
<entity name="AttributeOptionWhite" type="option">
566-
<data key="value">White</data>
567-
</entity>
568-
<!-- Color Product Attribute Options for API -->
569-
<entity name="TextSwatchOptionBlack" type="ProductAttributeOption">
570-
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
571-
<data key="label">Black</data>
572-
<data key="is_default">false</data>
573-
<data key="sort_order">0</data>
574-
</entity>
575-
<entity name="TextSwatchOptionWhite" type="ProductAttributeOption">
576-
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
577-
<data key="label">White</data>
578-
<data key="is_default">false</data>
579-
<data key="sort_order">1</data>
580-
</entity>
581-
<!-- Attribute Display Values for product configuration -->
582-
<entity name="SizeAttributeDisplay" type="display">
583-
<data key="small">my size: Small</data>
584-
<data key="large">my size: Large</data>
585-
<data key="small_black">my size: Small, color1: Black</data>
586-
<data key="large_black">my size: Large, color1: Black</data>
587-
<data key="small_white">my size: Small, color1: White</data>
588-
<data key="large_white">my size: Large, color1: White</data>
589-
</entity>
590-
<entity name="ConfigurableProduct1" type="product">
591-
<data key="name">Conf 1</data>
592-
<data key="sku">conf-1</data>
593-
<data key="price">100</data>
594-
</entity>
595-
<entity name="ConfigurableProduct2" type="product">
596-
<data key="name">Conf 2</data>
597-
<data key="sku">conf-2</data>
598-
<data key="price">200</data>
599-
</entity>
600495
</entities>
601496

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontValidatePriceChangesForConfigurableProductWithMultipleAttributesInWidgetTest.xml

Lines changed: 76 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,80 @@
2222
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2323
<!-- Create category for products -->
2424
<createData entity="_defaultCategory" stepKey="createCategory"/>
25-
<!-- Step-2: Create a dropdown product attribute with two options -->
26-
<createData entity="DropdownSizeAttributeData" stepKey="createDropdownAttribute"/>
27-
<createData entity="DropdownSizeOptionSmall" stepKey="createAttributeOptionSmall">
25+
<!-- Step-2: Create a dropdown product attribute -->
26+
<createData entity="productDropDownAttribute" stepKey="createDropdownAttribute">
27+
<field key="attribute_code">my_size</field>
28+
<field key="default_frontend_label">my size</field>
29+
<field key="frontend_input">select</field>
30+
<field key="scope">global</field>
31+
<field key="is_searchable">true</field>
32+
<field key="is_visible_in_advanced_search">true</field>
33+
<field key="is_visible_on_front">true</field>
34+
<field key="is_filterable">true</field>
35+
<field key="is_filterable_in_search">true</field>
36+
<field key="used_in_product_listing">true</field>
37+
<field key="is_used_for_promo_rules">true</field>
38+
<field key="is_comparable">true</field>
39+
<field key="used_for_sort_by">true</field>
40+
</createData>
41+
<createData entity="productAttributeOption" stepKey="createAttributeOptionSmall">
42+
<requiredEntity createDataKey="createDropdownAttribute"/>
43+
<field key="label">Small</field>
44+
<field key="sort_order">0</field>
45+
</createData>
46+
<createData entity="productAttributeOption" stepKey="createAttributeOptionMedium">
2847
<requiredEntity createDataKey="createDropdownAttribute"/>
48+
<field key="label">Medium</field>
49+
<field key="sort_order">1</field>
2950
</createData>
30-
<createData entity="DropdownSizeOptionLarge" stepKey="createAttributeOptionLarge">
51+
<createData entity="productAttributeOption" stepKey="createAttributeOptionLarge">
3152
<requiredEntity createDataKey="createDropdownAttribute"/>
53+
<field key="label">Large</field>
54+
<field key="sort_order">2</field>
55+
</createData>
56+
<!-- Step-3: Create a text swatch product attribute -->
57+
<createData entity="productDropDownAttribute" stepKey="createTextSwatchAttribute">
58+
<field key="attribute_code">color_swatch</field>
59+
<field key="default_frontend_label">color1</field>
60+
<field key="frontend_input">swatch_text</field>
61+
<field key="scope">global</field>
62+
<field key="is_searchable">true</field>
63+
<field key="is_visible_in_advanced_search">true</field>
64+
<field key="is_visible_on_front">true</field>
65+
<field key="is_filterable">true</field>
66+
<field key="is_filterable_in_search">true</field>
67+
<field key="used_in_product_listing">true</field>
68+
<field key="is_used_for_promo_rules">true</field>
69+
<field key="is_comparable">true</field>
70+
<field key="used_for_sort_by">true</field>
71+
</createData>
72+
<createData entity="productAttributeOption" stepKey="createAttributeOptionBlack">
73+
<requiredEntity createDataKey="createTextSwatchAttribute"/>
74+
<field key="label">Black</field>
75+
<field key="sort_order">0</field>
3276
</createData>
33-
<!-- Step-3: Create a text swatch product attribute with two options -->
34-
<createData entity="TextSwatchColorAttributeData" stepKey="createTextSwatchAttribute"/>
35-
<createData entity="TextSwatchOptionBlack" stepKey="createAttributeOptionBlack">
77+
<createData entity="productAttributeOption" stepKey="createAttributeOptionWhite">
3678
<requiredEntity createDataKey="createTextSwatchAttribute"/>
79+
<field key="label">White</field>
80+
<field key="sort_order">1</field>
3781
</createData>
38-
<createData entity="TextSwatchOptionWhite" stepKey="createAttributeOptionWhite">
82+
<createData entity="productAttributeOption" stepKey="createAttributeOptionBlue">
3983
<requiredEntity createDataKey="createTextSwatchAttribute"/>
84+
<field key="label">Blue</field>
85+
<field key="sort_order">2</field>
4086
</createData>
4187
<!-- Create configurable products -->
4288
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct1">
4389
<requiredEntity createDataKey="createCategory"/>
44-
<field key="name">{{ConfigurableProduct1.name}}</field>
45-
<field key="sku">{{ConfigurableProduct1.sku}}</field>
46-
<field key="price">{{ConfigurableProduct1.price}}</field>
90+
<field key="name">Conf 1</field>
91+
<field key="sku">conf-1</field>
92+
<field key="price">100</field>
4793
</createData>
4894
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct2">
4995
<requiredEntity createDataKey="createCategory"/>
50-
<field key="name">{{ConfigurableProduct2.name}}</field>
51-
<field key="sku">{{ConfigurableProduct2.sku}}</field>
52-
<field key="price">{{ConfigurableProduct2.price}}</field>
96+
<field key="name">Conf 2</field>
97+
<field key="sku">conf-2</field>
98+
<field key="price">200</field>
5399
</createData>
54100
</before>
55101
<after>
@@ -79,11 +125,11 @@
79125
</actionGroup>
80126
<!-- Set custom prices for Small and Large variants -->
81127
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForSmall">
82-
<argument name="productAttributes" value="{{SizeAttributeDisplay.small}}"/>
128+
<argument name="productAttributes" value="my size: Small"/>
83129
<argument name="productPrice" value="110"/>
84130
</actionGroup>
85131
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForLarge">
86-
<argument name="productAttributes" value="{{SizeAttributeDisplay.large}}"/>
132+
<argument name="productAttributes" value="my size: Large"/>
87133
<argument name="productPrice" value="130"/>
88134
</actionGroup>
89135
<actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigProduct1"/>
@@ -101,11 +147,11 @@
101147
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox($createTextSwatchAttribute.attribute_code$)}}" stepKey="selectColorAttribute"/>
102148
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1ForConf2"/>
103149
<!-- Select only Small and Large for my_size, and Black and White for color_swatch -->
104-
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName(AttributeOptionSmall.value)}}" stepKey="waitForOptionsForConf2"/>
105-
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName(AttributeOptionSmall.value)}}" stepKey="selectSmallOptionForConf2"/>
106-
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName(AttributeOptionLarge.value)}}" stepKey="selectLargeOptionForConf2"/>
107-
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName(AttributeOptionBlack.value)}}" stepKey="selectBlackOptionForConf2"/>
108-
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName(AttributeOptionWhite.value)}}" stepKey="selectWhiteOptionForConf2"/>
150+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName('Small')}}" stepKey="waitForOptionsForConf2"/>
151+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName('Small')}}" stepKey="selectSmallOptionForConf2"/>
152+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName('Large')}}" stepKey="selectLargeOptionForConf2"/>
153+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName('Black')}}" stepKey="selectBlackOptionForConf2"/>
154+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckboxByName('White')}}" stepKey="selectWhiteOptionForConf2"/>
109155
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2ForConf2"/>
110156
<!-- Apply single quantity to all SKUs -->
111157
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitForQuantitySection"/>
@@ -117,19 +163,19 @@
117163
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveButtonForConf2"/>
118164
<!-- Set custom prices for all variants -->
119165
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForBlackSmall">
120-
<argument name="productAttributes" value="{{SizeAttributeDisplay.small_black}}"/>
166+
<argument name="productAttributes" value="my size: Small, color1: Black"/>
121167
<argument name="productPrice" value="210"/>
122168
</actionGroup>
123169
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForBlackLarge">
124-
<argument name="productAttributes" value="{{SizeAttributeDisplay.large_black}}"/>
170+
<argument name="productAttributes" value="my size: Large, color1: Black"/>
125171
<argument name="productPrice" value="230"/>
126172
</actionGroup>
127173
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForWhiteSmall">
128-
<argument name="productAttributes" value="{{SizeAttributeDisplay.small_white}}"/>
174+
<argument name="productAttributes" value="my size: Small, color1: White"/>
129175
<argument name="productPrice" value="250"/>
130176
</actionGroup>
131177
<actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForWhiteLarge">
132-
<argument name="productAttributes" value="{{SizeAttributeDisplay.large_white}}"/>
178+
<argument name="productAttributes" value="my size: Large, color1: White"/>
133179
<argument name="productPrice" value="270"/>
134180
</actionGroup>
135181
<actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigProduct2"/>
@@ -140,23 +186,23 @@
140186
<actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveWidget"/>
141187
<!-- Step-7: Open Conf 1 product page on storefront and validate price changes -->
142188
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConf1ProductPage">
143-
<argument name="productUrl" value="{{ConfigurableProduct1.sku}}"/>
189+
<argument name="productUrl" value="conf-1"/>
144190
</actionGroup>
145191
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="waitForProductName"/>
146-
<waitForText selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ConfigurableProduct1.name}}" stepKey="verifyProductName"/>
192+
<waitForText selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Conf 1" stepKey="verifyProductName"/>
147193
<!-- Verify default price before selection -->
148194
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForDefaultPrice"/>
149195
<!-- Select Small option and verify price -->
150196
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="waitForAttributeDropdown"/>
151-
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="{{AttributeOptionSmall.value}}" stepKey="selectSmallOption"/>
197+
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="Small" stepKey="selectSmallOption"/>
152198
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceAfterSmallSelection"/>
153199
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$110.00" stepKey="verifySmallPrice"/>
154200
<!-- Select Large option and verify price changes -->
155-
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="{{AttributeOptionLarge.value}}" stepKey="selectLargeOption"/>
201+
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="Large" stepKey="selectLargeOption"/>
156202
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceAfterLargeSelection"/>
157203
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$130.00" stepKey="verifyLargePrice"/>
158204
<!-- Select Small again and verify price changes back -->
159-
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="{{AttributeOptionSmall.value}}" stepKey="selectSmallOptionAgain"/>
205+
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="Small" stepKey="selectSmallOptionAgain"/>
160206
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceAfterSmallSelectionAgain"/>
161207
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$110.00" stepKey="verifySmallPriceAgain"/>
162208
</test>

0 commit comments

Comments
 (0)