Skip to content

Commit 66509a0

Browse files
ENGCOM-9351: [MFTF] Refactoring MoveLastOrderedSimpleProductOnOrderPageTest #33688
- Merge Pull Request #33688 from AnnaAPak/magento2:ref-MoveLastOrderedSimpleProductOnOrderPageTest - Merged commits: 1. 89b1716 2. f61e313 3. 1c756c0
2 parents 7431f26 + 1c756c0 commit 66509a0

4 files changed

+92
-22
lines changed
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup">
11+
<annotations>
12+
<description>Checks the last ordered product on the Customer Edit page</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productName" type="string"/>
16+
</arguments>
17+
18+
<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder(productName)}}" stepKey="addLastOrderedProductToOrder"/>
19+
</actionGroup>
20+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup">
12+
<annotations>
13+
<description>Clicks Create Order Button on the Edit Customer Page</description>
14+
</annotations>
15+
16+
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
17+
<waitForPageLoad stepKey="waitForPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Sees Product in the "Items Ordered" Grid on th Create Order page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="rowIndex" type="string" defaultValue="1"/>
17+
<argument name="columnName" type="string" defaultValue="Product"/>
18+
<argument name="expectedValue" type="string"/>
19+
</arguments>
20+
21+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell(rowIndex, columnName)}}" userInput="{{expectedValue}}" stepKey="seeProductAttribute"/>
22+
</actionGroup>
23+
</actionGroups>

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

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,54 @@
2020
<group value="mtf_migrated"/>
2121
</annotations>
2222
<before>
23-
<!-- Login as admin -->
2423
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2524

26-
<!-- Create customer -->
2725
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
28-
29-
<!-- Create product -->
3026
<createData entity="SimpleProduct2" stepKey="createProduct"/>
27+
28+
<createData entity="CustomerCart" stepKey="createCustomerCart">
29+
<requiredEntity createDataKey="createCustomer"/>
30+
</createData>
31+
<createData entity="CustomerCartItem" stepKey="addCartItem">
32+
<requiredEntity createDataKey="createCustomerCart"/>
33+
<requiredEntity createDataKey="createProduct"/>
34+
</createData>
35+
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
36+
<requiredEntity createDataKey="createCustomerCart"/>
37+
</createData>
38+
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder">
39+
<requiredEntity createDataKey="createCustomerCart"/>
40+
</updateData>
3141
</before>
3242
<after>
33-
<!-- Delete created data -->
3443
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
3544
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3645
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/>
3746
</after>
3847

39-
<!-- Create order -->
40-
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
41-
<argument name="product" value="$$createProduct$$"/>
42-
<argument name="customer" value="$$createCustomer$$"/>
43-
</actionGroup>
44-
45-
<!-- Search and open customer -->
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/>
49+
4650
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
4751
<argument name="customerId" value="$createCustomer.id$"/>
4852
</actionGroup>
4953
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/>
5054
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/>
5155

52-
<!-- Click create order -->
53-
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
54-
55-
<!-- Select product in Last Ordered Items section -->
56-
<click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder($$createProduct.name$$)}}" stepKey="addProductToOrder"/>
57-
58-
<!-- Click Update Changes -->
56+
<actionGroup ref="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/>
57+
58+
<actionGroup ref="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup" stepKey="addProductToOrder">
59+
<argument name="productName" value="$$createProduct.name$$"/>
60+
</actionGroup>
61+
5962
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>
6063

61-
<!-- Assert product in items ordered grid -->
62-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createProduct.name$$" stepKey="seeProductName"/>
63-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createProduct.price$$" stepKey="seeProductPrice"/>
64+
<actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
65+
<argument name="expectedValue" value="$$createProduct.name$$"/>
66+
</actionGroup>
67+
<actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
68+
<argument name="columnName" value="Price"/>
69+
<argument name="expectedValue" value="$$createProduct.price$$"/>
70+
</actionGroup>
71+
6472
</test>
6573
</tests>

0 commit comments

Comments
 (0)