Skip to content

Commit bd313eb

Browse files
committed
MC-19683: Wrong "As low as" price on catalog page
- Fix wrong minimum price for configurable product on catalog page
1 parent 71d6954 commit bd313eb

File tree

9 files changed

+362
-35
lines changed

9 files changed

+362
-35
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<annotations>
1414
<description>Sets the Admin Products grid view to the 'Default View'.</description>
1515
</annotations>
16-
16+
1717
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
1818
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
1919
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
@@ -120,7 +120,7 @@
120120
<annotations>
121121
<description>Filters the Admin Products grid by the 'Enabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description>
122122
</annotations>
123-
123+
124124
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
125125
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
126126
<selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Enabled" stepKey="selectEnabledStatusFilter"/>
@@ -286,6 +286,27 @@
286286
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/>
287287
</actionGroup>
288288

289+
<actionGroup name="deleteProductsByKeyword">
290+
<annotations>
291+
<description>Delete products by keyword</description>
292+
</annotations>
293+
<arguments>
294+
<argument name="keyword" type="string"/>
295+
</arguments>
296+
297+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
298+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
299+
<fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordField"/>
300+
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="keywordSearchButton"/>
301+
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
302+
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/>
303+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
304+
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
305+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/>
306+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/>
307+
<see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/>
308+
</actionGroup>
309+
289310
<!--Open product for edit by clicking row X and column Y in product grid-->
290311
<actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid">
291312
<annotations>
@@ -314,7 +335,7 @@
314335
<annotations>
315336
<description>Filters the ID column in Ascending Order.</description>
316337
</annotations>
317-
338+
318339
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/>
319340
<waitForPageLoad stepKey="waitForPageLoad"/>
320341
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@
1717
<remove keyForRemoval="AssertProductPrice"/>
1818
<see userInput="{{product.price}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/>
1919
</actionGroup>
20+
<actionGroup name="StorefrontAssertProductPriceOnCategoryPageActionGroup" extends="StorefrontAssertProductPriceOnProductPageActionGroup">
21+
<annotations>
22+
<description>Validate that the provided Product Price is correct on category page.</description>
23+
</annotations>
24+
<arguments>
25+
<argument name="productName" type="string"/>
26+
</arguments>
27+
28+
<see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="seeProductPrice"/>
29+
</actionGroup>
2030
</actionGroups>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,12 @@
368368
<data key="frontend_input">swatch_visual</data>
369369
<data key="attribute_code" unique="suffix">visual_swatch</data>
370370
</entity>
371+
<entity name="ProductColorAttribute" type="ProductAttribute">
372+
<data key="frontend_label">Color</data>
373+
<data key="attribute_code" unique="suffix">color_attr</data>
374+
</entity>
375+
<entity name="ProductSizeAttribute" type="ProductAttribute">
376+
<data key="frontend_label">Size</data>
377+
<data key="attribute_code" unique="suffix">size_attr</data>
378+
</entity>
371379
</entities>

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

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<arguments>
1717
<argument name="product" defaultValue="_defaultProduct"/>
1818
</arguments>
19-
19+
2020
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
2121
<waitForPageLoad stepKey="waitForPageLoadInitial"/>
2222
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
@@ -108,6 +108,65 @@
108108
<seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/>
109109
</actionGroup>
110110

111+
<actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct">
112+
<annotations>
113+
<description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description>
114+
</annotations>
115+
<arguments>
116+
<argument name="attribute1" defaultValue="ProductColorAttribute"/>
117+
<argument name="attribute2" defaultValue="ProductSizeAttribute"/>
118+
</arguments>
119+
<remove keyForRemoval="clickOnNewAttribute"/>
120+
<remove keyForRemoval="waitForIFrame"/>
121+
<remove keyForRemoval="switchToNewAttributeIFrame"/>
122+
<remove keyForRemoval="fillDefaultLabel"/>
123+
<remove keyForRemoval="clickOnNewAttributePanel"/>
124+
<remove keyForRemoval="waitForSaveAttribute"/>
125+
<remove keyForRemoval="switchOutOfIFrame"/>
126+
<remove keyForRemoval="waitForFilters"/>
127+
<remove keyForRemoval="clickOnFilters"/>
128+
<remove keyForRemoval="fillFilterAttributeCodeField"/>
129+
<remove keyForRemoval="clickApplyFiltersButton"/>
130+
<remove keyForRemoval="clickOnFirstCheckbox"/>
131+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/>
132+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/>
133+
<remove keyForRemoval="waitCreateNewValueAppears"/>
134+
<remove keyForRemoval="clickOnCreateNewValue1"/>
135+
<remove keyForRemoval="fillFieldForNewAttribute1"/>
136+
<remove keyForRemoval="clickOnSaveNewAttribute1"/>
137+
<remove keyForRemoval="clickOnCreateNewValue2"/>
138+
<remove keyForRemoval="fillFieldForNewAttribute2"/>
139+
<remove keyForRemoval="clickOnSaveNewAttribute2"/>
140+
<remove keyForRemoval="clickOnCreateNewValue3"/>
141+
<remove keyForRemoval="fillFieldForNewAttribute3"/>
142+
<remove keyForRemoval="clickOnSaveNewAttribute3"/>
143+
<remove keyForRemoval="clickOnSelectAll"/>
144+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/>
145+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/>
146+
<remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/>
147+
<remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/>
148+
<remove keyForRemoval="selectAttributes"/>
149+
<remove keyForRemoval="fillAttributePrice1"/>
150+
<remove keyForRemoval="fillAttributePrice2"/>
151+
<remove keyForRemoval="fillAttributePrice3"/>
152+
<remove keyForRemoval="clickOnSaveButton2"/>
153+
<remove keyForRemoval="clickOnConfirmInPopup"/>
154+
<remove keyForRemoval="seeSaveProductMessage"/>
155+
<remove keyForRemoval="seeProductNameInTitle"/>
156+
</actionGroup>
157+
<actionGroup name="saveConfigurableProduct">
158+
<annotations>
159+
<description>Save configurable product</description>
160+
</annotations>
161+
<arguments>
162+
<argument name="product" defaultValue="_defaultProduct"/>
163+
</arguments>
164+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
165+
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
166+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
167+
<seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/>
168+
</actionGroup>
169+
111170
<actionGroup name="generateConfigurationsByAttributeCode">
112171
<annotations>
113172
<description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description>
@@ -296,12 +355,21 @@
296355
<fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/>
297356
<fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/>
298357
</actionGroup>
299-
358+
<actionGroup name="changeConfigurableProductChildProductPrice">
359+
<annotations>
360+
<description>Change the price of a configurable child product in the grid under configurations.</description>
361+
</annotations>
362+
<arguments>
363+
<argument name="productAttributes" type="string"/>
364+
<argument name="productPrice" type="string"/>
365+
</arguments>
366+
<fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/>
367+
</actionGroup>
300368
<actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid">
301369
<annotations>
302370
<description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description>
303371
</annotations>
304-
372+
305373
<remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/>
306374
<remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/>
307375
</actionGroup>

app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,40 @@
8484
<selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" stepKey="switchOnVisibleOnCatalogPagesOnStorefront" userInput="Yes" after="selectUseInLayer"/>
8585
<selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" stepKey="switchOnUsedInProductListing" userInput="Yes" after="switchOnVisibleOnCatalogPagesOnStorefront"/>
8686
</actionGroup>
87+
88+
<actionGroup name="AddTextSwatchToProductActionGroup">
89+
<annotations>
90+
<description>Add text swatch property attribute.</description>
91+
</annotations>
92+
<arguments>
93+
<argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/>
94+
<argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/>
95+
<argument name="option1" defaultValue="textSwatchOption1" type="string"/>
96+
<argument name="option2" defaultValue="textSwatchOption2" type="string"/>
97+
<argument name="option3" defaultValue="textSwatchOption3" type="string"/>
98+
<argument name="usedInProductListing" defaultValue="No" type="string"/>
99+
</arguments>
100+
101+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/>
102+
<waitForPageLoad stepKey="waitForNewProductAttributePage"/>
103+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
104+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/>
105+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/>
106+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/>
107+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/>
108+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/>
109+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/>
110+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/>
111+
<click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/>
112+
<fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3"/>
113+
<fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3Description"/>
114+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/>
115+
<selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/>
116+
<fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/>
117+
<scrollToTopOfPage stepKey="scrollToTabs"/>
118+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
119+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/>
120+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/>
121+
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/>
122+
</actionGroup>
87123
</actionGroups>

app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
</arguments>
1616
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/>
1717
</actionGroup>
18+
<actionGroup name="StorefrontAssertSwatchOptionPrice">
19+
<arguments>
20+
<argument name="optionName" type="string"/>
21+
<argument name="optionPrice" type="string"/>
22+
</arguments>
23+
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/>
24+
<see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/>
25+
</actionGroup>
1826

1927
<!--Click a swatch option on product page and check active image-->
2028
<actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage">

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313
<data key="input_type">Visual Swatch</data>
1414
<data key="attribute_code" unique="suffix">visual_swatch_attr</data>
1515
</entity>
16+
<entity name="textSwatchAttribute" type="SwatchAttribute">
17+
<data key="input_type">Text Swatch</data>
18+
<data key="default_label" unique="suffix">TextSwatchAttr</data>
19+
<data key="attribute_code" unique="suffix">text_swatch_attr</data>
20+
</entity>
1621
</entities>

0 commit comments

Comments
 (0)