Skip to content

Commit 94103b3

Browse files
committed
MAGETWO-64923: Duplicate products not showing on the frontend
- Update automated test script
1 parent bf7636e commit 94103b3

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
<selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/>
4444
<click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute"/>
4545
</actionGroup>
46+
<actionGroup name="AdminCreateAttributeFromProductPageWithSpecifiedVisibilityScope" extends="AdminCreateAttributeFromProductPage" insertAfter="selectAttributeType">
47+
<arguments>
48+
<argument name="scope" type="string" defaultValue="Store View"/>
49+
</arguments>
50+
<conditionalClick selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" dependentSelector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" visible="false" stepKey="openAttributeAdvancedSection"/>
51+
<selectOption selector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" userInput="{{scope}}" stepKey="selectScope"/>
52+
</actionGroup>
4653

4754
<actionGroup name="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPage" extends="AdminCreateAttributeFromProductPage">
4855
<remove keyForRemoval="saveAttribute"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<section name="AdminProductFormNewAttributeAdvancedSection">
2626
<element name="sectionHeader" type="button" selector="div[data-index='advanced_fieldset']"/>
2727
<element name="defaultValue" type="textarea" selector="input[name='default_value_text']"/>
28+
<element name="scope" type="select" selector="//div[@data-index='advanced_fieldset']//select[@name='is_global']"/>
2829
</section>
2930
<section name="AdminProductFormNewAttributeStorefrontSection">
3031
<element name="sectionHeader" type="button" selector="div[data-index='front_fieldset']"/>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@
136136
</actionGroup>
137137
<actionGroup name="createOptionsForAttribute">
138138
<arguments>
139-
<argument name="attributeName" type="string"/>
140-
<argument name="firstOptionName" type="string"/>
141-
<argument name="secondOptionName" type="string"/>
139+
<argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/>
140+
<argument name="firstOptionName" type="string" defaultValue="option1"/>
141+
<argument name="secondOptionName" type="string" defaultValue="option2"/>
142142
</arguments>
143143
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
144144
<fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/>
@@ -299,9 +299,9 @@
299299
</actionGroup>
300300
<actionGroup name="addUniqueQuantityToConfigurableProductOption">
301301
<arguments>
302-
<argument name="frontend_label" type="string"/>
303-
<argument name="label" type="string"/>
304-
<argument name="quantity" type="string"/>
302+
<argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/>
303+
<argument name="label" type="string" defaultValue="option1"/>
304+
<argument name="quantity" type="string" defaultValue="10"/>
305305
</arguments>
306306
<click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" dependentSelector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" visible="false" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/>
307307
<selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/>
@@ -345,7 +345,7 @@
345345
</actionGroup>
346346
<actionGroup name="AdminConfigurableProductDisableConfigurationsActionGroup">
347347
<arguments>
348-
<argument name="productName" type="string"/>
348+
<argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/>
349349
</arguments>
350350
<click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/>
351351
<click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@
5353
<actionGroup ref="addProductImage" stepKey="addImageForProduct1">
5454
<argument name="image" value="MagentoLogo"/>
5555
</actionGroup>
56-
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
57-
<actionGroup ref="AdminCreateAttributeForConfigurableProduct" stepKey="createFirstProductAttribute">
56+
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>
57+
<actionGroup ref="AdminCreateAttributeFromProductPageWithSpecifiedVisibilityScope" stepKey="createAttributeForProduct">
5858
<argument name="attributeName" value="{{colorProductAttribute.default_label}}"/>
5959
<argument name="attributeType" value="{{colorProductAttribute.input_type}}"/>
60+
<argument name="scope" value="Global"/>
6061
</actionGroup>
62+
<reloadPage stepKey="reloadPage"/>
63+
<waitForPageLoad stepKey="waitForProductPageReload"/>
64+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
6165
<waitForPageLoad stepKey="waitForFilters"/>
6266
<actionGroup ref="createOptionsForAttribute" stepKey="createOptions">
6367
<argument name="attributeName" value="{{colorProductAttribute.default_label}}"/>
@@ -106,15 +110,14 @@
106110
<waitForPageLoad stepKey="waitForSummaryPageLoad"/>
107111
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToGenerateConfigs"/>
108112
<waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/>
109-
<actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/>
113+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
110114
<!--Duplicate the product-->
111115
<comment userInput="Duplicate the product" stepKey="commentDuplicateProduct"/>
112116
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm"/>
113117
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProduct"/>
114118
<fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/>
115119
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="1" stepKey="selectInStock"/>
116120
<!--Change product image-->
117-
<comment userInput="Change product image" stepKey="commentChangeImage"/>
118121
<comment userInput="Change product image" stepKey="commentChangeProductImage"/>
119122
<actionGroup ref="removeProductImage" stepKey="removeProductImage"/>
120123
<actionGroup ref="addProductImage" stepKey="addImageForProduct">
@@ -128,13 +131,17 @@
128131
<actionGroup ref="AdminConfigurableProductDisableConfigurationsActionGroup" stepKey="disableSecondConfig">
129132
<argument name="productName" value="{{colorConfigurableProductAttribute2.name}}"/>
130133
</actionGroup>
134+
<actionGroup ref="saveProductForm" stepKey="saveDuplicatedProductForm"/>
131135
<!--Create new configurations with another attribute-->
132136
<comment userInput="Create new configurations with another attribute" stepKey="commentCreateNewConfigurations"/>
133-
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurationsForDuplicatedProduct"/>
134-
<actionGroup ref="AdminCreateAttributeForConfigurableProduct" stepKey="createFirstProductAttributeForDuplicatedProduct">
137+
<actionGroup ref="AdminCreateAttributeFromProductPageWithSpecifiedVisibilityScope" stepKey="createAttributeForDuplicatedProduct">
135138
<argument name="attributeName" value="{{productAttributeColor.default_label}}"/>
139+
<argument name="attributeType" value="{{productAttributeColor.input_type}}"/>
140+
<argument name="scope" value="Global"/>
136141
</actionGroup>
137-
<waitForPageLoad stepKey="waitForFiltersForDuplicatedProduct"/>
142+
<reloadPage stepKey="reloadDuplicatedProductPage"/>
143+
<waitForPageLoad stepKey="waitForDuplicatedProductReload"/>
144+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurationsForDuplicatedProduct"/>
138145
<actionGroup ref="createOptionsForAttribute" stepKey="createOptionsForDuplicatedProduct">
139146
<argument name="attributeName" value="{{productAttributeColor.default_label}}"/>
140147
<argument name="firstOptionName" value="{{colorConfigurableProductAttribute1.name}}"/>
@@ -176,7 +183,7 @@
176183
<waitForPageLoad stepKey="waitForSummaryPageLoadForDuplicatedProduct"/>
177184
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToGenerateConfigsForDuplicatedProduct"/>
178185
<waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/>
179-
<actionGroup ref="saveConfiguredProduct" stepKey="saveDuplicatedProductForm"/>
186+
<actionGroup ref="saveProductForm" stepKey="saveDuplicatedProduct"/>
180187
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
181188
<magentoCLI command="cache:flush" stepKey="flushCache"/>
182189
<!--Assert configurable product in category-->

0 commit comments

Comments
 (0)