Skip to content

Commit 228c323

Browse files
ENGCOM-9327: [MFTF] StorefrontVerifyOrderShipmentForDecimalQuantityTest refactoring #34152
- Merge Pull Request #34152 from AnnaAPak/magento2:ref-StorefrontVerifyOrderShipmentForDecimalQuantityTest - Merged commits: 1. 2bdb295 2. a462612
2 parents 227cf92 + a462612 commit 228c323

File tree

2 files changed

+38
-29
lines changed

2 files changed

+38
-29
lines changed
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+
<actionGroup name="StorefrontOpenOrderShipmentsTabByOrderIdActionGroup">
12+
<annotations>
13+
<description>Opens the Order Shipments tab on the Order View page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="orderId" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{StorefrontCustomerOrderShipmentPage.url(orderId)}}" stepKey="amOnOrderShipmentPage"/>
20+
<waitForPageLoad stepKey="waitForOrderShipmentTabLoad"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,21 @@
2929
</createData>
3030
</before>
3131
<after>
32-
<!--Clear Filters-->
33-
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/>
32+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="ClearFiltersAfter"/>
3433
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clearOrderListingFilters"/>
3534
<deleteData createDataKey="createSimpleCategory" stepKey="deletePreReqCategory"/>
3635
<deleteData createDataKey="createSimpleProduct" stepKey="deletePreReqSimpleProduct"/>
37-
<!--Logout from customer account-->
3836
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomerOne"/>
3937
<waitForPageLoad stepKey="waitLogoutCustomerOne"/>
4038
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
4139
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4240
</after>
43-
<!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit-->
4441
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" />
45-
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions">
46-
<argument name="product" value="$$createSimpleProduct$$"/>
42+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
43+
<argument name="productId" value="$$createSimpleProduct.id$$"/>
4744
</actionGroup>
48-
<!-- Step2. Update product Advanced Inventory Setting.
49-
Set *Qty Uses Decimals* to *Yes* and *Enable Qty Increments* to *Yes* and *Qty Increments* to *2.14*. -->
50-
<actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/>
45+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterGroupedProductOptions"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openProduct"/>
5147
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
5248
<actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig">
5349
<argument name="value" value="Yes"/>
@@ -62,44 +58,35 @@
6258
<argument name="qty" value="2.14"/>
6359
</actionGroup>
6460
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
65-
66-
<!--Step3. Save the product-->
6761
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/>
68-
<!--Step4. Open *Customer view* (Go to *Store Front*). Open *prod1* page (Find via search and click on product name) -->
69-
<!--Step5. Log in to Storefront as Customer-->
7062
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser">
7163
<argument name="Customer" value="$$createSimpleUsCustomer$$"/>
7264
</actionGroup>
73-
<!--Step6. Go to product page-->
74-
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/>
75-
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
76-
<!--Step7. Add Product to Shopping Cart-->
65+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToSimpleProductPage">
66+
<argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
67+
</actionGroup>
68+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCatalogPageLoad"/>
7769
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
7870
<argument name="productName" value="$$createSimpleProduct.name$$"/>
7971
</actionGroup>
8072

81-
<!--Step8. Navigate to checkout-->
8273
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
83-
<!--Step9. Click next button to open payment section-->
8474
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
85-
<!--Step10. Click place order-->
8675
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
87-
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabOrderNumber"/>
8877
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
8978
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
90-
91-
<!--Step11. Go to admin Order page for newly created order-->
9279
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
9380
<argument name="entityId" value="$grabOrderId"/>
9481
</actionGroup>
9582

96-
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
97-
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
98-
83+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="clickShipAction"/>
84+
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="clickSubmitShipment"/>
9985
<actionGroup ref="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup" stepKey="goToOrderHistoryPage"/>
100-
<!--Step12. Go to Customer Order Shipment Page and Checking the correctness of displayed Qty Shipped -->
101-
<amOnPage url="{{StorefrontCustomerOrderShipmentPage.url({$grabOrderNumber})}}" stepKey="amOnOrderShipmentPage"/>
102-
<waitForPageLoad time="30" stepKey="waitForOrderShipmentsPageLoad"/>
86+
<actionGroup ref="StorefrontOpenOrderShipmentsTabByOrderIdActionGroup" stepKey="amOnOrderShipmentPage">
87+
<argument name="orderId" value="$grabOrderId"/>
88+
</actionGroup>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderShipmentsPageLoad"/>
10390
<actionGroup ref="AssertStorefrontOrderShipmentsQtyShippedActionGroup" stepKey="verifyAssertOrderShipments">
10491
<argument name="expectedQtyShipped" value="2.14"/>
10592
</actionGroup>

0 commit comments

Comments
 (0)