Skip to content

Commit afbf460

Browse files
ENGCOM-6566: MFTF: Extract Action Groups to separate files - magento/module-shipping #26321
- Merge Pull Request #26321 from lbajsarowicz/magento2:refactor/mftf-shipping - Merged commits: 1. 0e5643f 2. 93e0800 3. fc8dee7
2 parents dbb159a + fc8dee7 commit afbf460

11 files changed

+177
-62
lines changed

app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646

4747
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/>
4848
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/>
49-
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/>
50-
<actionGroup ref="submitShipmentIntoOrder" stepKey="submitShipment"/>
49+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/>
50+
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/>
5151

5252
<!--Create Credit Memo-->
5353
<actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo">

app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<!--Create Invoice-->
112112
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/>
113113
<!--Create shipping label-->
114-
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipmentIntoOrder"/>
114+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipmentIntoOrder"/>
115115
<checkOption selector="{{AdminShipmentTotalSection.createShippingLabel}}" stepKey="checkCreateShippingLabel"/>
116116
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
117117
<actionGroup ref="AdminShipmentCreateShippingLabelActionGroup" stepKey="createPackage">

app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/>
8989

9090
<!--Verify invoiced items qty in ship tab-->
91-
<actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/>
91+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/>
9292
<grabTextFrom selector="{{AdminShipmentItemsSection.itemQtyInvoiced('1')}}" stepKey="grabInvoicedItemQty"/>
9393
<assertEquals expected="5" expectedType="string" actual="$grabInvoicedItemQty" stepKey="assertInvoicedItemsQty"/>
9494
</test>
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+
<actionGroup name="AdminGoToShipmentTabActionGroup">
12+
<click selector="{{AdminOrderDetailsOrderViewSection.shipments}}" stepKey="clickOrderShipmentsTab"/>
13+
<waitForLoadingMaskToDisappear stepKey="waitForShipmentTabLoad" after="clickOrderShipmentsTab"/>
14+
</actionGroup>
15+
</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="AdminShipmentCreateShippingLabelActionGroup">
12+
<arguments>
13+
<argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/>
14+
</arguments>
15+
<waitForElementVisible selector="{{AdminShipmentCreatePackageMainSection.addProductsToPackage}}" stepKey="waitForAddProductElement"/>
16+
<click selector="{{AdminShipmentCreatePackageMainSection.addProductsToPackage}}" stepKey="clickAddProducts"/>
17+
<waitForElementVisible selector="{{AdminShipmentCreatePackageProductGridSection.concreteProductCheckbox('productName')}}" stepKey="waitForProductBeVisible"/>
18+
<checkOption selector="{{AdminShipmentCreatePackageProductGridSection.concreteProductCheckbox('productName')}}" stepKey="checkProductCheckbox"/>
19+
<waitForElementVisible selector="{{AdminShipmentCreatePackageMainSection.addSelectedProductToPackage}}" stepKey="waitForAddSelectedProductElement"/>
20+
<click selector="{{AdminShipmentCreatePackageMainSection.addSelectedProductToPackage}}" stepKey="clickAddSelectedProduct"/>
21+
<waitForElementNotVisible selector="{{AdminShipmentCreatePackageMainSection.saveButtonDisabled}}" stepKey="waitForBeEnabled"/>
22+
<click selector="{{AdminShipmentCreatePackageMainSection.save}}" stepKey="clickSave"/>
23+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear"/>
24+
<waitForPageLoad stepKey="waitForSaving"/>
25+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created. You created the shipping label." stepKey="seeShipmentCreateSuccess"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="GoToShipmentIntoOrderActionGroup">
12+
<annotations>
13+
<description>Clicks on the 'Ship' button on the view Admin Order page. Validates that the URL and Page Title are present and correct.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
17+
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
18+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Shipment" stepKey="seePageNameNewInvoicePage"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="SeeProductInShipmentItemsActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Product is present and correct on the view Admin Order Shipment page under the 'Items Shipped' section.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product"/>
17+
</arguments>
18+
19+
<see selector="{{AdminShipmentItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="SubmitShipmentIntoOrderActionGroup">
12+
<annotations>
13+
<description>Clicks on the 'Submit Shipment' button on the view Admin Order Shipment page. Validates that the URL and Page Title are present and correct.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
17+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageShipping"/>
18+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="VerifyBasicShipmentInformationActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Customer, Shipping Address, Billing Address and Customer Group are present and correct on the view Admin Order page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customer" defaultValue=""/>
17+
<argument name="shippingAddress" defaultValue=""/>
18+
<argument name="billingAddress" defaultValue=""/>
19+
<argument name="customerGroup" defaultValue="GeneralCustomerGroup"/>
20+
</arguments>
21+
22+
<see selector="{{AdminShipmentOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/>
23+
<see selector="{{AdminShipmentOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/>
24+
<see selector="{{AdminShipmentOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/>
25+
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/>
26+
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/>
27+
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/>
28+
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/>
29+
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/>
30+
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/>
31+
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/>
32+
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/>
33+
</actionGroup>
34+
</actionGroups>

app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminShipmentActionGroup.xml renamed to app/code/Magento/Shipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,36 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Temporary file to pass CI verification -->
12+
<actionGroup name="goToShipmentIntoOrder">
13+
<annotations>
14+
<description>Clicks on the 'Ship' button on the view Admin Order page. Validates that the URL and Page Title are present and correct.</description>
15+
</annotations>
16+
17+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
18+
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
19+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Shipment" stepKey="seePageNameNewInvoicePage"/>
20+
</actionGroup>
21+
<actionGroup name="submitShipmentIntoOrder">
22+
<annotations>
23+
<description>Clicks on the 'Submit Shipment' button on the view Admin Order Shipment page. Validates that the URL and Page Title are present and correct.</description>
24+
</annotations>
25+
26+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
27+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageShipping"/>
28+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/>
29+
</actionGroup>
30+
<actionGroup name="seeProductInShipmentItems">
31+
<annotations>
32+
<description>Validates that the provided Product is present and correct on the view Admin Order Shipment page under the 'Items Shipped' section.</description>
33+
</annotations>
34+
<arguments>
35+
<argument name="product"/>
36+
</arguments>
37+
38+
<see selector="{{AdminShipmentItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
39+
</actionGroup>
1140
<actionGroup name="verifyBasicShipmentInformation">
1241
<annotations>
1342
<description>Validates that the provided Customer, Shipping Address, Billing Address and Customer Group are present and correct on the view Admin Order page.</description>
@@ -18,7 +47,7 @@
1847
<argument name="billingAddress" defaultValue=""/>
1948
<argument name="customerGroup" defaultValue="GeneralCustomerGroup"/>
2049
</arguments>
21-
50+
2251
<see selector="{{AdminShipmentOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/>
2352
<see selector="{{AdminShipmentOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/>
2453
<see selector="{{AdminShipmentOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/>
@@ -31,55 +60,4 @@
3160
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/>
3261
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/>
3362
</actionGroup>
34-
35-
<actionGroup name="seeProductInShipmentItems">
36-
<annotations>
37-
<description>Validates that the provided Product is present and correct on the view Admin Order Shipment page under the 'Items Shipped' section.</description>
38-
</annotations>
39-
<arguments>
40-
<argument name="product"/>
41-
</arguments>
42-
43-
<see selector="{{AdminShipmentItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
44-
</actionGroup>
45-
46-
<actionGroup name="goToShipmentIntoOrder">
47-
<annotations>
48-
<description>Clicks on the 'Ship' button on the view Admin Order page. Validates that the URL and Page Title are present and correct.</description>
49-
</annotations>
50-
51-
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
52-
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
53-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Shipment" stepKey="seePageNameNewInvoicePage"/>
54-
</actionGroup>
55-
56-
<actionGroup name="submitShipmentIntoOrder">
57-
<annotations>
58-
<description>Clicks on the 'Submit Shipment' button on the view Admin Order Shipment page. Validates that the URL and Page Title are present and correct.</description>
59-
</annotations>
60-
61-
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
62-
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageShipping"/>
63-
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/>
64-
</actionGroup>
65-
<actionGroup name="AdminShipmentCreateShippingLabelActionGroup">
66-
<arguments>
67-
<argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/>
68-
</arguments>
69-
<waitForElementVisible selector="{{AdminShipmentCreatePackageMainSection.addProductsToPackage}}" stepKey="waitForAddProductElement"/>
70-
<click selector="{{AdminShipmentCreatePackageMainSection.addProductsToPackage}}" stepKey="clickAddProducts"/>
71-
<waitForElementVisible selector="{{AdminShipmentCreatePackageProductGridSection.concreteProductCheckbox('productName')}}" stepKey="waitForProductBeVisible"/>
72-
<checkOption selector="{{AdminShipmentCreatePackageProductGridSection.concreteProductCheckbox('productName')}}" stepKey="checkProductCheckbox"/>
73-
<waitForElementVisible selector="{{AdminShipmentCreatePackageMainSection.addSelectedProductToPackage}}" stepKey="waitForAddSelectedProductElement"/>
74-
<click selector="{{AdminShipmentCreatePackageMainSection.addSelectedProductToPackage}}" stepKey="clickAddSelectedProduct"/>
75-
<waitForElementNotVisible selector="{{AdminShipmentCreatePackageMainSection.saveButtonDisabled}}" stepKey="waitForBeEnabled"/>
76-
<click selector="{{AdminShipmentCreatePackageMainSection.save}}" stepKey="clickSave"/>
77-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear"/>
78-
<waitForPageLoad stepKey="waitForSaving"/>
79-
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created. You created the shipping label." stepKey="seeShipmentCreateSuccess"/>
80-
</actionGroup>
81-
<actionGroup name="AdminGoToShipmentTabActionGroup">
82-
<click selector="{{AdminOrderDetailsOrderViewSection.shipments}}" stepKey="clickOrderShipmentsTab"/>
83-
<waitForLoadingMaskToDisappear stepKey="waitForShipmentTabLoad" after="clickOrderShipmentsTab"/>
84-
</actionGroup>
8563
</actionGroups>

0 commit comments

Comments
 (0)