Skip to content

Commit bf7636e

Browse files
committed
MAGETWO-64923: Duplicate products not showing on the frontend
- Added automated test script
1 parent 41c0bbf commit bf7636e

File tree

5 files changed

+258
-0
lines changed

5 files changed

+258
-0
lines changed

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,37 @@
122122
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
123123
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
124124
</actionGroup>
125+
<actionGroup name="AdminCreateAttributeForConfigurableProduct">
126+
<arguments>
127+
<argument name="attributeName" type="string"/>
128+
</arguments>
129+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/>
130+
<waitForPageLoad stepKey="waitForIFrame"/>
131+
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
132+
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
133+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/>
134+
<waitForPageLoad stepKey="waitForSaveAttribute"/>
135+
<switchToIFrame stepKey="switchOutOfIFrame"/>
136+
</actionGroup>
137+
<actionGroup name="createOptionsForAttribute">
138+
<arguments>
139+
<argument name="attributeName" type="string"/>
140+
<argument name="firstOptionName" type="string"/>
141+
<argument name="secondOptionName" type="string"/>
142+
</arguments>
143+
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
144+
<fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/>
145+
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>
146+
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/>
147+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/>
148+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/>
149+
<fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/>
150+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/>
151+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/>
152+
<fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/>
153+
<click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/>
154+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/>
155+
</actionGroup>
125156

126157
<actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode">
127158
<arguments>
@@ -266,6 +297,16 @@
266297
<selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/>
267298
<fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/>
268299
</actionGroup>
300+
<actionGroup name="addUniqueQuantityToConfigurableProductOption">
301+
<arguments>
302+
<argument name="frontend_label" type="string"/>
303+
<argument name="label" type="string"/>
304+
<argument name="quantity" type="string"/>
305+
</arguments>
306+
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" dependentSelector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" visible="false" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/>
307+
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/>
308+
<fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/>
309+
</actionGroup>
269310

270311
<actionGroup name="saveConfigurableProductWithNewAttributeSet">
271312
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/>
@@ -302,4 +343,12 @@
302343
<waitForPageLoad stepKey="waitForNextStepLoaded"/>
303344
<see userInput="{{title}}" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeStepTitle"/>
304345
</actionGroup>
346+
<actionGroup name="AdminConfigurableProductDisableConfigurationsActionGroup">
347+
<arguments>
348+
<argument name="productName" type="string"/>
349+
</arguments>
350+
<click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/>
351+
<click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/>
352+
<see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/>
353+
</actionGroup>
305354
</actionGroups>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<data key="name" unique="suffix">Orange</data>
3030
<data key="price">99.99</data>
3131
</entity>
32+
<entity name="productAttributeColor" type="product_attribute">
33+
<data key="default_label" unique="suffix">color</data>
34+
<data key="input_type">Dropdown</data>
35+
<data key="attribute_quantity">1</data>
36+
</entity>
3237
<entity name="colorDefaultProductAttribute" type="product_attribute">
3338
<data key="default_label">Color</data>
3439
<data key="input_type">Dropdown</data>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
<element name="attribute3" type="input" selector="#apply-single-price-input-2"/>
4040

4141
<element name="applySingleQuantityToEachSkus" type="radio" selector=".admin__field-label[for='apply-single-inventory-radio']" timeout="30"/>
42+
<element name="applyUniqueQuantityToEachSkus" type="radio" selector=".admin__field-label[for='apply-unique-inventory-radio']" timeout="30"/>
43+
<element name="selectQuantity" type="select" selector="#apply-single-price-input-qty" timeout="30"/>
44+
<element name="applyUniqueQuantity" type="input" selector="//*[text()='{{option}}']/../..//input[contains(@id, 'apply-qty-input')]" parameterized="true"/>
4245
<element name="applyUniqueImagesToEachSkus" type="radio" selector=".admin__field-label[for='apply-unique-images-radio']" timeout="30"/>
4346
<element name="applyUniquePricesToEachSkus" type="radio" selector=".admin__field-label[for='apply-unique-prices-radio']" timeout="30"/>
4447
<element name="selectImagesButton" type="select" selector="#apply-images-attributes" timeout="30"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<element name="confProductPriceCell" type="input" selector="//*[.='Attributes']/ancestor::tr//span[contains(text(), '{{var}}')]/ancestor::tr/td[@data-index='price_container']//input" parameterized="true"/>
3333
<element name="confProductQuantityCell" type="input" selector="//*[.='Attributes']/ancestor::tr//span[contains(text(), '{{var}}')]/ancestor::tr/td[@data-index='quantity_container']//input" parameterized="true"/>
3434
<element name="confProductWeightCell" type="input" selector="//*[.='Attributes']/ancestor::tr//span[contains(text(), '{{var}}')]/ancestor::tr/td[@data-index='price_weight']//input" parameterized="true"/>
35+
<element name="confProductOptionStatusCell" type="text" selector="//*[.='Attributes']/ancestor::tr//span[contains(text(), '{{var}}')]/ancestor::tr/td[@data-index='status']" parameterized="true"/>
3536
<element name="confProductSkuMessage" type="text" selector="//*[@name='configurable-matrix[{{arg}}][sku]']/following-sibling::label" parameterized="true"/>
3637
<element name="variationsSkuInputByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) input[name*='sku']" type="input" parameterized="true"/>
3738
<element name="variationsSkuInputErrorByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) .admin__field-error" type="text" parameterized="true"/>

0 commit comments

Comments
 (0)