Skip to content

Commit 9425570

Browse files
committed
ACQE:8577: Validate price changes for configurable product with dropdown and text swatch attributes displayed in widget
- Added assertions for config2 product
1 parent e419577 commit 9425570

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

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

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<features value="Catalog"/>
1414
<stories value="Product Price Display"/>
1515
<title value="Validate price changes for configurable product with dropdown and text swatch attributes on storefront"/>
16-
<description value="Create dropdown and text swatch attributes, create two configurable products with different attribute combinations, and validate price changes on storefront product page"/>
16+
<description value="Verify configurable product price updates correctly when selecting different attribute options including products displayed in widgets"/>
1717
<testCaseId value="AC-8423"/>
1818
<severity value="MAJOR"/>
1919
<group value="Catalog"/>
@@ -27,63 +27,36 @@
2727
<createData entity="productDropDownAttribute" stepKey="createDropdownAttribute">
2828
<field key="attribute_code">my_size</field>
2929
<field key="default_frontend_label">my size</field>
30-
<field key="frontend_input">select</field>
31-
<field key="scope">global</field>
32-
<field key="is_searchable">true</field>
33-
<field key="is_visible_in_advanced_search">true</field>
34-
<field key="is_visible_on_front">true</field>
35-
<field key="is_filterable">true</field>
36-
<field key="is_filterable_in_search">true</field>
37-
<field key="used_in_product_listing">true</field>
38-
<field key="is_used_for_promo_rules">true</field>
39-
<field key="is_comparable">true</field>
40-
<field key="used_for_sort_by">true</field>
4130
</createData>
4231
<createData entity="productAttributeOption" stepKey="createAttributeOptionSmall">
4332
<requiredEntity createDataKey="createDropdownAttribute"/>
4433
<field key="label">Small</field>
45-
<field key="sort_order">0</field>
4634
</createData>
4735
<createData entity="productAttributeOption" stepKey="createAttributeOptionMedium">
4836
<requiredEntity createDataKey="createDropdownAttribute"/>
4937
<field key="label">Medium</field>
50-
<field key="sort_order">1</field>
5138
</createData>
5239
<createData entity="productAttributeOption" stepKey="createAttributeOptionLarge">
5340
<requiredEntity createDataKey="createDropdownAttribute"/>
5441
<field key="label">Large</field>
55-
<field key="sort_order">2</field>
5642
</createData>
5743
<!-- Step-3: Create a text swatch product attribute -->
5844
<createData entity="productDropDownAttribute" stepKey="createTextSwatchAttribute">
5945
<field key="attribute_code">color_swatch</field>
6046
<field key="default_frontend_label">color1</field>
6147
<field key="frontend_input">swatch_text</field>
62-
<field key="scope">global</field>
63-
<field key="is_searchable">true</field>
64-
<field key="is_visible_in_advanced_search">true</field>
65-
<field key="is_visible_on_front">true</field>
66-
<field key="is_filterable">true</field>
67-
<field key="is_filterable_in_search">true</field>
68-
<field key="used_in_product_listing">true</field>
69-
<field key="is_used_for_promo_rules">true</field>
70-
<field key="is_comparable">true</field>
71-
<field key="used_for_sort_by">true</field>
7248
</createData>
7349
<createData entity="productAttributeOption" stepKey="createAttributeOptionBlack">
7450
<requiredEntity createDataKey="createTextSwatchAttribute"/>
7551
<field key="label">Black</field>
76-
<field key="sort_order">0</field>
7752
</createData>
7853
<createData entity="productAttributeOption" stepKey="createAttributeOptionWhite">
7954
<requiredEntity createDataKey="createTextSwatchAttribute"/>
8055
<field key="label">White</field>
81-
<field key="sort_order">1</field>
8256
</createData>
8357
<createData entity="productAttributeOption" stepKey="createAttributeOptionBlue">
8458
<requiredEntity createDataKey="createTextSwatchAttribute"/>
8559
<field key="label">Blue</field>
86-
<field key="sort_order">2</field>
8760
</createData>
8861
<!-- Create configurable products -->
8962
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct1">
@@ -180,7 +153,7 @@
180153
<argument name="productPrice" value="270"/>
181154
</actionGroup>
182155
<actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigProduct2"/>
183-
<!-- Step-6: Create Catalog Products List widget -->
156+
<!-- Step-6: Create Catalog Products List widget to display Conf 2 on configurable product pages -->
184157
<actionGroup ref="AdminConfigureWidgetWithSpecificProductsActionGroup" stepKey="configureWidget">
185158
<argument name="productId" value="$createConfigProduct1.id$"/>
186159
</actionGroup>
@@ -206,5 +179,40 @@
206179
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="Small" stepKey="selectSmallOptionAgain"/>
207180
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceAfterSmallSelectionAgain"/>
208181
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$110.00" stepKey="verifySmallPriceAgain"/>
182+
<!-- Verify Conf 2 is displayed in widget on Conf 1 product page and validate price changes -->
183+
<scrollTo selector="{{StorefrontCategoryProductSection.widgetProduct('Conf 2')}}" stepKey="scrollToWidgetProduct"/>
184+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.widgetProduct('Conf 2')}}" stepKey="verifyConf2DisplayedInWidget"/>
185+
<!-- Click on Conf 2 from widget to navigate to its product page -->
186+
<click selector="{{StorefrontCategoryProductSection.widgetProduct('Conf 2')}}" stepKey="clickConf2FromWidget"/>
187+
<waitForPageLoad stepKey="waitForConf2PageLoad"/>
188+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="waitForConf2ProductName"/>
189+
<waitForText selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Conf 2" stepKey="verifyConf2ProductName"/>
190+
<!-- Verify price changes for Conf 2 with multiple attribute combinations -->
191+
<!-- Select Black color swatch -->
192+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Black')}}" stepKey="waitForBlackSwatch"/>
193+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Black')}}" stepKey="selectBlackSwatch"/>
194+
<waitForPageLoad stepKey="waitAfterBlackSelection"/>
195+
<!-- Select Small size with Black color and verify price -->
196+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" stepKey="waitForSizeDropdownForBlack"/>
197+
<selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" userInput="Small" stepKey="selectSmallForBlack"/>
198+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceBlackSmall"/>
199+
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$210.00" stepKey="verifyBlackSmallPrice"/>
200+
<!-- Select Large size with Black color and verify price -->
201+
<selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" userInput="Large" stepKey="selectLargeForBlack"/>
202+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceBlackLarge"/>
203+
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$230.00" stepKey="verifyBlackLargePrice"/>
204+
<!-- Select White color swatch -->
205+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('White')}}" stepKey="waitForWhiteSwatch"/>
206+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('White')}}" stepKey="selectWhiteSwatch"/>
207+
<waitForPageLoad stepKey="waitAfterWhiteSelection"/>
208+
<!-- Select Small size with White color and verify price -->
209+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" stepKey="waitForSizeDropdownForWhite"/>
210+
<selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" userInput="Small" stepKey="selectSmallForWhite"/>
211+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceWhiteSmall"/>
212+
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$250.00" stepKey="verifyWhiteSmallPrice"/>
213+
<!-- Select Large size with White color and verify price -->
214+
<selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID('my size')}}" userInput="Large" stepKey="selectLargeForWhite"/>
215+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="waitForPriceWhiteLarge"/>
216+
<waitForText selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$270.00" stepKey="verifyWhiteLargePrice"/>
209217
</test>
210218
</tests>

0 commit comments

Comments
 (0)