Skip to content

Commit fb72934

Browse files
committed
Merge remote-tracking branch 'dmitry/CreateShipmentEntity' into test-migration-pr
2 parents 49cf443 + f11586f commit fb72934

12 files changed

+300
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
12+
<actionGroup name="AdminAssertCreatedShipmentsInShipmentsTabActionGroup">
13+
<click stepKey="navigateToShipmentsTab" selector="{{AdminOrderDetailsOrderViewSection.shipments}}"/>
14+
<waitForPageLoad stepKey="waitForTabLoad"/>
15+
<grabTextFrom selector="{{AdminShipmentsGridSection.shipmentId}}" stepKey="grabShipmentId"/>
16+
<assertNotEmpty actual="$grabShipmentId" stepKey="assertShipmentIdIsNotEmpty" after="grabShipmentId"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertShipmentInShipmentsGrid">
12+
<arguments>
13+
<argument name="shipmentId" type="string"/>
14+
</arguments>
15+
<!--Assert Shipment in Shipments Grid-->
16+
<amOnPage url="{{AdminShipmentsGridPage.url}}" stepKey="onShipmentsGridPage"/>
17+
<waitForPageLoad stepKey="waitForLoadingPage"/>
18+
<conditionalClick selector="{{AdminShipmentsGridSection.clearFilters}}" dependentSelector="{{AdminShipmentsGridSection.clearFilters}}" visible="true" stepKey="clearFilter"/>
19+
<waitForLoadingMaskToDisappear stepKey="waitForFilterLoad"/>
20+
<click selector="{{AdminShipmentsGridSection.buttonFilters}}" stepKey="openFilterSearch"/>
21+
<waitForLoadingMaskToDisappear stepKey="waitForFilterFields"/>
22+
<fillField userInput="{{shipmentId}}" selector="{{AdminShipmentsGridSection.fieldShipment}}" stepKey="fillSearchByShipmentId"/>
23+
<click selector="{{AdminShipmentsGridSection.applyFilter}}" stepKey="clickSearchButton"/>
24+
<waitForLoadingMaskToDisappear stepKey="waitForSearchResult"/>
25+
<see userInput="{{shipmentId}}" selector="{{AdminShipmentsGridSection.rowShipments}}" stepKey="seeShipmentId"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
12+
<actionGroup name="AdminAssertShipmentItemsActionGroup">
13+
<arguments>
14+
<argument name="product" defaultValue="" type="string"/>
15+
<argument name="qty" defaultValue="" type="string"/>
16+
</arguments>
17+
<click selector="{{AdminShipmentsGridSection.shipmentId}}" stepKey="clickView"/>
18+
<scrollTo selector="{{AdminShipmentItemsSection.itemName('1')}}" stepKey="scrollToShippedItems"/>
19+
<see userInput="{{product}}" selector="{{AdminShipmentItemsSection.itemName('1')}}" stepKey="seeProductName"/>
20+
<see userInput="{{qty}}" selector="{{AdminShipmentItemsSection.productQty}}" stepKey="seeQty"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--Create Shipment With Tracking Number-->
12+
<actionGroup name="AdminCreateShipmentFromOrderPage">
13+
<arguments>
14+
<argument name="Title" defaultValue="" type="string"/>
15+
<argument name="Number" defaultValue="" type="string"/>
16+
<argument name="Comment" defaultValue="" type="string"/>
17+
<argument name="Qty" defaultValue="" type="string"/>
18+
</arguments>
19+
20+
<click stepKey="clickShipButton" selector="{{AdminOrderDetailsMainActionsSection.ship}}"/>
21+
<click stepKey="clickAddTrackingNumber" selector="{{AdminShipmentPaymentShippingSection.AddTrackingNumber}}"/>
22+
<fillField stepKey="fillTitle" userInput="{{Title}}" selector="{{AdminShipmentPaymentShippingSection.Title('1')}}"/>
23+
<fillField stepKey="fillNumber" userInput="{{Number}}" selector="{{AdminShipmentPaymentShippingSection.Number('1')}}"/>
24+
<fillField stepKey="fillQty" userInput="{{Qty}}" selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}"/>
25+
<fillField stepKey="fillComment" userInput="{{Comment}}" selector="{{AdminShipmentTotalSection.CommentText}}"/>
26+
<click stepKey="clickSubmitButton" selector="{{AdminShipmentMainActionsSection.submitShipment}}"/>
27+
<see userInput="The shipment has been created." stepKey="seeSuccessMessage"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--Create Shipment With Tracking Number-->
12+
<actionGroup name="AssertThereIsNoShipButtonActionGroup">
13+
<dontSee stepKey="dontSeeShipButton" selector="{{AdminOrderDetailsMainActionsSection.ship}}"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminShipmentsGridPage" url="sales/shipment/" area="admin" module="Magento_Sales">
12+
<section name="AdminShipmentsGridSection"/>
13+
</page>
14+
</pages>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
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
<element name="itemQtyInvoiced" type="text" selector="(//*[@class='col-ordered-qty']//th[contains(text(), 'Invoiced')]/following-sibling::td)[{{var}}]" parameterized="true"/>
19+
<element name="productQty" type="text" selector="td.col-qty"/>
1920
</section>
2021
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<element name="AddTrackingNumber" type="button" selector="#tracking_numbers_table tfoot [data-ui-id='shipment-tracking-add-button']"/>
1818
<element name="Carrier" type="select" selector="#tracking_numbers_table tr:nth-of-type({{row}}) .col-carrier select" parameterized="true"/>
1919
<element name="Title" type="input" selector="#tracking_numbers_table tr:nth-of-type({{row}}) .col-title input" parameterized="true"/>
20-
<element name="Number" type="input" selector="#tracking_numbers_table tr:nth-of-type({{row}} .col-number input)" parameterized="true"/>
20+
<element name="Number" type="input" selector="#tracking_numbers_table tr:nth-of-type({{row}}) .col-number input" parameterized="true"/>
2121
<element name="Delete" type="button" selector="#tracking_numbers_table tr:nth-of-type({{row}} .col-delete button.action-delete)" parameterized="true"/>
2222
</section>
2323
</sections>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminShipmentsGridSection">
12+
<element name="shipmentId" type="text" selector="//*[@id='sales_order_view_tabs_order_shipments_content']//tbody/tr/td[2]/div"/>
13+
<element name="clearFilters" type="button" selector="button.action-tertiary.action-clear"/>
14+
<element name="buttonFilters" type="button" selector=".data-grid-filters-action-wrap > button"/>
15+
<element name="fieldShipment" type="input" selector="input[name='increment_id']"/>
16+
<element name="applyFilter" type="button" selector="button[data-action='grid-filter-apply']"/>
17+
<element name="rowShipments" type="text" selector="div.data-grid-cell-content"/>
18+
</section>
19+
</sections>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminCreatePartialShipmentEntityTest">
12+
<annotations>
13+
<stories value="Create Partial Shipment Entity"/>
14+
<title value="Create Partial Shipment for Offline Payment Methods"/>
15+
<description value="Admin Should be Able to Create Partial Shipments"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-13331"/>
18+
<group value="sales"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
24+
<!-- Create Data -->
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
27+
</createData>
28+
<!-- Enable payment method one of "Check/Money Order" and shipping method one of "Free Shipping" -->
29+
<magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/>
30+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
31+
<magentoCLI command="cache:clean config" stepKey="flushCache"/>
32+
</before>
33+
<after>
34+
<!-- Delete data -->
35+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
36+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
37+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
38+
<actionGroup ref="logout" stepKey="logout"/>
39+
</after>
40+
41+
<!-- TEST BODY -->
42+
<!-- Create Order -->
43+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage">
44+
<argument name="customer" value="$$createCustomer$$"/>
45+
</actionGroup>
46+
<actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder">
47+
<argument name="product" value="$$createSimpleProduct$$"/>
48+
<argument name="productQty" value="2"/>
49+
</actionGroup>
50+
<!-- Select Free shipping -->
51+
<actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/>
52+
<!--Click *Submit Order* button-->
53+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/>
54+
<!-- Create Partial Shipment -->
55+
<actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="createNewShipment">
56+
<argument name="Qty" value="1"/>
57+
<argument name="Title" value="Title"/>
58+
<argument name="Number" value="199"/>
59+
<argument name="Comment" value="comments for shipment"/>
60+
</actionGroup>
61+
<!-- Assert There is no "Ship Button" in Order Information -->
62+
<actionGroup ref="AssertThereIsNoShipButtonActionGroup" stepKey="dontSeeShipButton"/>
63+
<!-- Assert Created Shipment in Shipments Tab-->
64+
<actionGroup ref="AdminAssertCreatedShipmentsInShipmentsTabActionGroup" stepKey="assertCreatedShipment"/>
65+
<grabTextFrom selector="{{AdminShipmentsGridSection.shipmentId}}" stepKey="grabShipmentId"/>
66+
<!-- Assert Shipment items -->
67+
<actionGroup ref="AdminAssertShipmentItemsActionGroup" stepKey="assertShipmentItems">
68+
<argument name="product" value="$$createSimpleProduct.name$$"/>
69+
<argument name="qty" value="1"/>
70+
</actionGroup>
71+
<!-- Assert Created Shipment in Shipments Grid-->
72+
<actionGroup ref="AdminAssertShipmentInShipmentsGrid" stepKey="assertShipmentInGrid">
73+
<argument name="shipmentId" value="{$grabShipmentId}"/>
74+
</actionGroup>
75+
</test>
76+
</tests>

0 commit comments

Comments
 (0)