Skip to content

Commit 87082e6

Browse files
committed
MAGETWO-96545: Wrong calculation of invoiced items in shipment document in order with bundle product after partial invoice
- Add automated test script
1 parent 2fb6b3b commit 87082e6

File tree

2 files changed

+93
-1
lines changed

2 files changed

+93
-1
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCorrectnessInvoicedItemInBundleProductTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<title value="Check correctness of invoiced items in a Bundle Product"/>
15+
<description value="Check correctness of invoiced items in a Bundle Product"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-11059"/>
18+
<useCaseId value="MC-10969"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
24+
<!--Create category and simple product-->
25+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
26+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!--Create bundle product-->
31+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
35+
<requiredEntity createDataKey="createBundleProduct"/>
36+
</createData>
37+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
38+
<requiredEntity createDataKey="createBundleProduct"/>
39+
<requiredEntity createDataKey="bundleOption"/>
40+
<requiredEntity createDataKey="createSimpleProduct"/>
41+
<field key="qty">10</field>
42+
</createData>
43+
</before>
44+
<after>
45+
<!--Delete created data-->
46+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
47+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
48+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
49+
50+
<actionGroup ref="logout" stepKey="logOut"/>
51+
</after>
52+
53+
<!--Complete Bundle product creation-->
54+
<amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/>
55+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
56+
57+
<!--Go to bundle product page-->
58+
<amOnPage url="{{StorefrontProductPage.url($$createCategory.name$$)}}" stepKey="navigateToBundleProductPage"/>
59+
60+
<!--Place order bundle product with 10 options-->
61+
<actionGroup ref="StorefrontAddCategoryBundleProductToCartActionGroup" stepKey="addBundleProductToCart">
62+
<argument name="product" value="$$createBundleProduct$$"/>
63+
<argument name="quantity" value="10"/>
64+
</actionGroup>
65+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" />
66+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"/>
67+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="placeOrder">
68+
<argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage" />
69+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
70+
</actionGroup>
71+
72+
<!--Go to order page submit invoice-->
73+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
74+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
75+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById">
76+
<argument name="orderId" value="$grabOrderNumber"/>
77+
</actionGroup>
78+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
79+
<waitForPageLoad stepKey="waitForCreatedOrderPageOpened"/>
80+
<actionGroup ref="goToInvoiceIntoOrder" stepKey="goToInvoiceIntoOrderPage"/>
81+
<fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="5" stepKey="ChangeQtyToInvoice"/>
82+
<click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQunatity"/>
83+
<waitForPageLoad stepKey="waitPageToBeLoaded"/>
84+
<actionGroup ref="submitInvoiceIntoOrder" stepKey="submitInvoice"/>
85+
86+
<!--Verify invoiced items qty in ship tab-->
87+
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/>
88+
<grabTextFrom selector="{{AdminShipmentItemsSection.itemQtyInvoiced('1')}}" stepKey="grabInvoicedItemQty"/>
89+
<assertEquals expected="5" expectedType="string" actual="$grabInvoicedItemQty" stepKey="assertInvoicedItemsQty"/>
90+
</test>
91+
</tests>

app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentItemsSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="itemQtyToShip" type="input" selector=".order-shipment-table tbody:nth-of-type({{var1}}) .col-qty input.qty-item" parameterized="true"/>
1616
<element name="nameColumn" type="text" selector=".order-shipment-table .col-product .product-title"/>
1717
<element name="skuColumn" type="text" selector=".order-shipment-table .col-product .product-sku-block"/>
18+
<element name="itemQtyInvoiced" type="text" selector="(//*[@class='col-ordered-qty']//th[contains(text(), 'Invoiced')]/following-sibling::td)[{{var}}]" parameterized="true"/>
1819
</section>
19-
</sections>
20+
</sections>

0 commit comments

Comments
 (0)