Skip to content

Commit 74ee7b5

Browse files
committed
Merge branch 'MAGETWO-60034' of github.com:magento-earl-grey/magento2ce into MAGETWO-60034
2 parents 9864ab8 + f752669 commit 74ee7b5

File tree

3 files changed

+185
-1
lines changed

3 files changed

+185
-1
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Sales/ActionGroup/AdminOrderActionGroup.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@
6060
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
6161
</actionGroup>
6262

63+
<!--Add a simple product to order with user defined quantity-->
64+
<actionGroup name="addSimpleProductToOrderWithCustomQuantity">
65+
<arguments>
66+
<argument name="product" defaultValue="_defaultProduct"/>
67+
<argument name="quantity" type="string"/>
68+
</arguments>
69+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMastToDisappear"/>
70+
<waitForElementVisible selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="waitForAddProductButton"/>
71+
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
72+
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/>
73+
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/>
74+
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
75+
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
76+
<fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{quantity}}" stepKey="fillProductQty"/>
77+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
78+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
79+
</actionGroup>
80+
6381
<!--Add configurable product to order -->
6482
<actionGroup name="addConfigurableProductToOrder">
6583
<arguments>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<test name="AdminAbleToShipPartiallyInvoicedItemsTest">
11+
<annotations>
12+
<title value="Ship Action is available for remaining of the partially invoiced items "/>
13+
<description value="Admin should be able to ship remaining ordered items if some of them are already refunded"/>
14+
<severity value="CRITICAL"/>
15+
<testCaseId value="MAGETWO-93030"/>
16+
<group value="sales"/>
17+
18+
</annotations>
19+
<before>
20+
<createData entity="_defaultCategory" stepKey="createCategory"/>
21+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
22+
<requiredEntity createDataKey="createCategory"/>
23+
</createData>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
27+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
28+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
29+
</after>
30+
31+
<!--login to Admin-->
32+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
33+
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
34+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
35+
<waitForPageLoad stepKey="waitForIndexPageLoad"/>
36+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
37+
38+
<!--Create new order-->
39+
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
40+
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
41+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
42+
<actionGroup ref="addSimpleProductToOrderWithCustomQuantity" stepKey="addSimpleProductToOrderWithUserDefinedQty">
43+
<argument name="product" value="_defaultProduct"/>
44+
<argument name="quantity" value="10"/>
45+
</actionGroup>
46+
47+
<!--Fill customer group and customer email which both are now required fields-->
48+
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrderWithUserDefinedQty"/>
49+
<fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/>
50+
51+
<!--Fill customer address information-->
52+
<actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail">
53+
<argument name="customer" value="Simple_US_Customer"/>
54+
<argument name="address" value="US_Address_TX"/>
55+
</actionGroup>
56+
<!-- Select shipping -->
57+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/>
58+
59+
<!--Verify totals on Order page-->
60+
<see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="$1,230.00" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/>
61+
<see selector="{{AdminOrderFormTotalSection.total('Shipping')}}" userInput="$50.00" stepKey="seeOrderShipping" after="seeOrderSubTotal"/>
62+
<scrollTo selector="{{AdminOrderFormTotalSection.grandTotal}}" stepKey="scrollToOrderGrandTotal"/>
63+
<see selector="{{AdminOrderFormTotalSection.grandTotal}}" userInput="$1,280.00" stepKey="seeCorrectGrandTotal" after="scrollToOrderGrandTotal"/>
64+
65+
<!--Submit Order and verify information-->
66+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder" after="seeCorrectGrandTotal"/>
67+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/>
68+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage" after="seeViewOrderPage"/>
69+
<grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeSuccessMessage"/>
70+
<scrollTo selector="{{AdminOrderItemsOrderedSection.qtyColumn}}" stepKey="scrollToItemsOrdered" after="getOrderId"/>
71+
<see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Ordered 10" stepKey="seeQtyOfItemsOrdered" after="scrollToItemsOrdered"/>
72+
73+
<!--Create order invoice for first half of ordered items-->
74+
<comment userInput="Admin creates invoice for order" stepKey="adminCreateInvoiceComment" />
75+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceActionButton"/>
76+
<!--<seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl" after="clickInvoiceAction"/>-->
77+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage" after="clickInvoiceActionButton"/>
78+
<scrollTo selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced"/>
79+
80+
<!--Verify items invoiced information-->
81+
<fillField selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" userInput="5" stepKey="invoiceHalfTheItems"/>
82+
<click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQtyToBeInvoiced"/>
83+
<waitForLoadingMaskToDisappear stepKey="WaitForQtyToUpdate"/>
84+
<waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitforSubmitInvoiceBtn"/>
85+
86+
<!--Submit Invoice-->
87+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/>
88+
<waitForLoadingMaskToDisappear stepKey="WaitForInvoiceToSubmit"/>
89+
<!--<waitForElementVisible selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="waitUntilInvoiceSucesssMsg"/>-->
90+
91+
<!--Invoice created successfully-->
92+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceSuccessMessage"/>
93+
<click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoicesTab"/>
94+
<waitForLoadingMaskToDisappear stepKey="waitForInvoiceGridToLoad" after="clickInvoicesTab"/>
95+
<see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="$665.00" stepKey="seeOrderInvoiceTabInGrid" after="waitForInvoiceGridToLoad"/>
96+
<click selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="clickToViewInvoice" after="seeOrderInvoiceTabInGrid"/>
97+
<click selector="{{AdminInvoiceOrderInformationSection.orderId}}" stepKey="clickOrderIdLinkOnInvoice"/>
98+
99+
<!--Ship Order-->
100+
<comment userInput="Admin creates shipment" stepKey="adminCreatesShipmentComment" before="clickShip"/>
101+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShip" after="clickOrderIdLinkOnInvoice"/>
102+
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="OrderShipmentUrl" after="clickShip"/>
103+
<scrollTo selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" stepKey="scrollToItemsToShip"/>
104+
<see selector="{{AdminShipmentItemsSection.itemQty('1')}}" userInput="Invoiced 5" stepKey="see5itemsInvoiced"/>
105+
<fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="5" stepKey="fillQtyOfItemsToShip"/>
106+
107+
<!--Submit Shipment-->
108+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="submitShipment" after="fillQtyOfItemsToShip"/>
109+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="successfullShipmentCreation" after="submitShipment"/>
110+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="$getOrderId" stepKey="seeOrderIdInPageTitleAfterShip"/>
111+
112+
<!--Verify Items Status and Shipped Qty in the Items Ordered section-->
113+
<scrollTo selector="{{AdminOrderItemsOrderedSection.itemStatus('1')}}" stepKey="scrollToItemsShipped"/>
114+
<see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 5" stepKey="see5itemsShipped"/>
115+
116+
<!--Create Credit Memo-->
117+
<comment userInput="Admin creates credit memo" stepKey="createCreditMemoComment"/>
118+
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo" after="createCreditMemoComment"/>
119+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle"/>
120+
121+
<!--Update Qty of items to be refunded and submit refund-->
122+
<scrollTo selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" stepKey="scrollToItemsToRefund"/>
123+
<fillField selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" userInput="5" stepKey="fillQtyOfItemsToRefund" after="scrollToItemsToRefund"/>
124+
<click selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="updateRefundQty"/>
125+
<waitForLoadingMaskToDisappear stepKey="waitForRefundQtyToUpdate"/>
126+
<waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="seeSubmitRefundBtn"/>
127+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="submitRefundOffline"/>
128+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the credit memo." stepKey="seeCreditMemoSuccessMsg" after="submitRefundOffline"/>
129+
130+
<!--Create invoice for rest of the ordered items-->
131+
<comment userInput="Admin creates invoice for rest of the items" stepKey="adminCreateInvoiceComment2" />
132+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceActionForRestOfItems"/>
133+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage2" after="clickInvoiceActionForRestOfItems"/>
134+
135+
<comment userInput="Qty To Invoice is 5" stepKey="seeRemainderInQtyToInvoice"/>
136+
<scrollTo selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced2"/>
137+
<!--<see selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced2"/>-->
138+
<seeInField userInput="5" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="see5InTheQtyToInvoice"/>
139+
140+
<!--Verify items invoiced information-->
141+
<see selector="{{AdminInvoiceItemsSection.itemQty('1')}}" userInput="Refunded 5" stepKey="seeQtyOfItemsRefunded"/>
142+
143+
<!--Submit Invoice-->
144+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice2" />
145+
146+
<!--Invoice created successfully for the rest of the ordered items-->
147+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceSuccessMessage2" after="submitInvoice2"/>
148+
149+
<!--Verify Ship Action can be done for the rest of the invoiced items -->
150+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipActionForRestOfItems" after="seeInvoiceSuccessMessage2"/>
151+
152+
<!--Verify Items To Ship section -->
153+
<scrollTo selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" stepKey="scrollToItemsToShip2"/>
154+
<see selector="{{AdminShipmentItemsSection.itemQty('1')}}" userInput="Invoiced 10" stepKey="SeeAll10ItemsInvoiced"/>
155+
<fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="5" stepKey="fillRestOfItemsToShip"/>
156+
157+
<!--Submit Shipment-->
158+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="submitShipment2" after="fillRestOfItemsToShip"/>
159+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="successfullyCreatedShipment" after="submitShipment2"/>
160+
161+
<!--Verify Items Status and Shipped Qty in the Items Ordered section-->
162+
<scrollTo selector="{{AdminOrderItemsOrderedSection.itemStatus('1')}}" stepKey="scrollToItemsOrdered2"/>
163+
<see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 10" stepKey="seeAllItemsShipped"/>
164+
</test>
165+
</tests>
166+

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Shipping/Section/AdminShipmentItemsSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<element name="itemName" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-product .product-title" parameterized="true"/>
1313
<element name="itemSku" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-product .product-sku-block" parameterized="true"/>
1414
<element name="itemQty" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-ordered-qty .qty-table" parameterized="true"/>
15-
<element name="itemQtyToShip" type="input" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-qty input.qty-item"/>
15+
<element name="itemQtyToShip" type="input" selector=".order-shipment-table tbody:nth-of-type({{row}}) .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"/>
1818
</section>

0 commit comments

Comments
 (0)