Skip to content

Commit 0ce0246

Browse files
committed
MAGETWO-94004: Magento Admin can not configure properly bundle/grouped/configurable product with shared catalog enabled and if they were added by sku to an order
- Added automated test script
1 parent 5791131 commit 0ce0246

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@
206206
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
207207
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
208208
</entity>
209+
<entity name="ApiSimpleProductWithShortSKU" type="product2" extends="ApiSimpleOne">
210+
<data key="sku" unique="suffix">pr</data>
211+
</entity>
209212
<entity name="ApiSimpleOneHidden" type="product2">
210213
<data key="sku" unique="suffix">api-simple-product</data>
211214
<data key="type_id">simple</data>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,50 @@
131131
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
132132
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
133133
</actionGroup>
134+
<actionGroup name="AdminAddProductToOrderBySKU">
135+
<arguments>
136+
<argument name="productSKU" type="string"/>
137+
<argument name="productQty" type="string"/>
138+
<argument name="productNumber" type="string"/>
139+
</arguments>
140+
<click selector="{{AdminOrderFormItemsOrderedSection.addProductsBySku}}" stepKey="clickAddProduct"/>
141+
<fillField selector="{{AdminOrderFormItemsSection.skuNumber(productNumber)}}" userInput="{{productSKU}}" stepKey="fillProductSKU"/>
142+
<fillField selector="{{AdminOrderFormItemsSection.qty(productNumber)}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
143+
<click selector="{{AdminOrderFormItemsSection.addToOrder}}" stepKey="clickAddToOrder"/>
144+
</actionGroup>
145+
<actionGroup name="AdminOrderConfigureConfigurableProduct">
146+
<arguments>
147+
<argument name="optionName" type="string"/>
148+
<argument name="productQty" type="string"/>
149+
</arguments>
150+
<click selector="{{AdminOrderFormItemsOrderedSection.configureButtonBySku}}" stepKey="clickConfigure"/>
151+
<waitForPageLoad stepKey="waitForConfigurePageLoad"/>
152+
<selectOption selector="{{AdminOrderFormConfigureProductSection.attributeSelect}}" userInput="{{optionName}}" stepKey="selectOption"/>
153+
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
154+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
155+
</actionGroup>
156+
<actionGroup name="AdminOrderConfigureBundleProduct">
157+
<arguments>
158+
<argument name="productName" type="string"/>
159+
<argument name="productQty" type="string"/>
160+
<argument name="productNumber" type="string"/>
161+
</arguments>
162+
<click selector="{{AdminOrderFormItemsOrderedSection.configureButtonBySku}}" stepKey="clickConfigure"/>
163+
<waitForPageLoad stepKey="waitForConfigurePageLoad"/>
164+
<checkOption selector="{{AdminOrderFormConfigureProductSection.bundleProductCheckbox(productNumber)}}" stepKey="checkProduct"/>
165+
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
166+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
167+
</actionGroup>
168+
<actionGroup name="AdminOrderConfigureGroupedProduct">
169+
<arguments>
170+
<argument name="productSku" type="string"/>
171+
<argument name="productQty" type="string"/>
172+
</arguments>
173+
<click selector="{{AdminOrderFormItemsOrderedSection.configureButtonBySku}}" stepKey="clickConfigure"/>
174+
<waitForPageLoad stepKey="waitForConfigurePageLoad"/>
175+
<fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(productSku)}}" userInput="{{productQty}}" stepKey="fillOptionQuantity"/>
176+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
177+
</actionGroup>
134178

135179
<!--Add configurable product to order -->
136180
<actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder">

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<element name="optionSelect" type="select" selector="//div[@class='product-options']/div/div/select[../../label[text() = '{{option}}']]" parameterized="true"/>
1313
<element name="quantity" type="input" selector="#product_composite_configure_input_qty"/>
1414
<element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/>
15+
<element name="attributeSelect" type="select" selector="//div[contains(@class, 'product-options')]//select" timeout="30"/>
16+
<element name="bundleProductCheckbox" type="checkbox" selector="(//input[contains(@class, 'admin__control-checkbox') and contains(@class, 'bundle-option')])[{{row}}]" parameterized="true"/>
1517
</section>
16-
</sections>
18+
</sections>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']"/>
1717
<element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/>
1818
<element name="configureSelectAttribute" type="select" selector="select[id*=attribute]"/>
19+
<element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/>
1920
</section>
2021
</sections>

0 commit comments

Comments
 (0)