Skip to content

Commit 62111e3

Browse files
committed
createShipmentEntityTest
1 parent 02bca98 commit 62111e3

12 files changed

+297
-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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
<group value="sales"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
25+
</createData>
26+
<!-- Enable payment method one of "Check/Money Order" and shipping method one of "Free Shipping" -->
27+
<magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/>
28+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
29+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
30+
</before>
31+
<after>
32+
<!-- Delete data -->
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
35+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
39+
<!-- TEST BODY -->
40+
<!-- Create Order -->
41+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage">
42+
<argument name="customer" value="$$createCustomer$$"/>
43+
</actionGroup>
44+
<actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder">
45+
<argument name="product" value="$$createSimpleProduct$$"/>
46+
<argument name="productQty" value="2"/>
47+
</actionGroup>
48+
<!-- Select Free shipping -->
49+
<actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/>
50+
<!--Click *Submit Order* button-->
51+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/>
52+
<!-- Create Partial Shipment -->
53+
<actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="createNewShipment">
54+
<argument name="Qty" value="1"/>
55+
<argument name="Title" value="Title"/>
56+
<argument name="Number" value="199"/>
57+
<argument name="Comment" value="comments for shipment"/>
58+
</actionGroup>
59+
<!-- Assert There is no "Ship Button" in Order Information -->
60+
<actionGroup ref="AssertThereIsNoShipButtonActionGroup" stepKey="dontSeeShipButton"/>
61+
<!-- Assert Created Shipment in Shipments Tab-->
62+
<actionGroup ref="AdminAssertCreatedShipmentsInShipmentsTabActionGroup" stepKey="assertCreatedShipment"/>
63+
<grabTextFrom selector="{{AdminShipmentsGridSection.shipmentId}}" stepKey="grabShipmentId"/>
64+
<!-- Assert Shipment items -->
65+
<actionGroup ref="AdminAssertShipmentItemsActionGroup" stepKey="assertShipmentItems">
66+
<argument name="product" value="$$createSimpleProduct.name$$"/>
67+
<argument name="qty" value="1"/>
68+
</actionGroup>
69+
<!-- Assert Created Shipment in Shipments Grid-->
70+
<actionGroup ref="AdminAssertShipmentInShipmentsGrid" stepKey="assertShipmentInGrid">
71+
<argument name="shipmentId" value="{$grabShipmentId}"/>
72+
</actionGroup>
73+
</test>
74+
</tests>

0 commit comments

Comments
 (0)