Skip to content

Commit 2378ab2

Browse files
committed
Merge branch 'add-AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup' into ref-CreateOrderFromEditCustomerPageTest
2 parents a262a50 + 8aee821 commit 2378ab2

12 files changed

+216
-46
lines changed
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+
12+
<actionGroup name="AdminClickCreateOrderOnEditCustomerPageActionGroup">
13+
<annotations>
14+
<description>Clicks on 'Create Order' on the Edit Customer page.</description>
15+
</annotations>
16+
17+
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
18+
<waitForPageLoad stepKey="waitForPageLoaded"/>
19+
20+
</actionGroup>
21+
</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="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup">
12+
<annotations>
13+
<description>Asserts product in Items Ordered Grid on Create Order page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="index" type="string"/>
17+
<argument name="attribute" type="string"/>
18+
<argument name="value" type="string"/>
19+
</arguments>
20+
21+
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell(index, attribute)}}" userInput="{{value}}" stepKey="seeProductAttribute"/>
22+
</actionGroup>
23+
</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+
<actionGroup name="AdminClickConfigureForRecentlyViewedProductActionGroup">
12+
<annotations>
13+
<description>Clicks the "Configure" button for a Product in Recently Viewed Product section on Create Order Page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure(productName)}}" stepKey="clickConfigureProduct"/>
20+
21+
</actionGroup>
22+
</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="AdminClickOkOnConfigureProductSlidingModalActionGroup">
12+
<annotations>
13+
<description>Clicks the "Ok" button on the "Configure Product" sliding modal on the Create Order page</description>
14+
</annotations>
15+
16+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/>
17+
<waitForPageLoad stepKey="waitForAddingConfiguredProduct"/>
18+
19+
</actionGroup>
20+
</actionGroups>
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="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup">
12+
<annotations>
13+
<description>Selects a required option in dropdown on the "Configure Product" Sliding Modal</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionName" type="string"/>
17+
</arguments>
18+
19+
<selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{optionName}}" stepKey="selectOption"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerEditPageToLoad"/>
104104
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickOnCreateOrderButton"/>
105105
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
106-
<conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/>
106+
<actionGroup ref="AdminSelectStoreViewOnCreateOrderPageIfRequestedActionGroup" stepKey="selectStoreViewIfAppears"/>
107107

108108
<!--Add configurable product to order-->
109109
<actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder">
@@ -123,10 +123,19 @@
123123
</actionGroup>
124124

125125
<!-- Move Products to the WishList -->
126-
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveProductToWishList"/>
127-
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$createConfigProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveConfigurableProductToWishList"/>
128-
<click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItemsAndQuantity"/>
129-
<waitForPageLoad stepKey="waitForAdminCreateOrderWishListSectionPageLoad"/>
126+
<actionGroup ref="AdminSelectValueFromActionSelectInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="moveProductToWishList">
127+
<argument name="product" value="$$simpleProduct$$"/>
128+
<argument name="option" value="Move to Wish List"/>
129+
</actionGroup>
130+
<actionGroup ref="AdminSelectValueFromActionSelectInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="moveConfigurableProductToWishList">
131+
<argument name="product" value="$$createConfigProduct$$"/>
132+
<argument name="option" value="Move to Wish List"/>
133+
</actionGroup>
134+
135+
<!-- <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveProductToWishList"/>
136+
<selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$createConfigProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveConfigurableProductToWishList"/> -->
137+
<actionGroup ref="AdminClickUpdateItemsAndQuantitesOnCreateOrderPageActionGroup" stepKey="clickOnUpdateItemsAndQuantity"/>
138+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForAdminCreateOrderWishListSectionPageLoad"/>
130139

131140
<!-- Assert products in Wish List section -->
132141
<see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList"/>

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,25 @@
156156
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>
157157

158158
<!-- Assert products in items ordered grid -->
159-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstConfigProduct.name$$" stepKey="seeFirstProductName"/>
160-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeFirstProductPrice"/>
161-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondConfigProduct.name$$" stepKey="seeSecondProductName"/>
162-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$123.00" stepKey="seeSecondProductPrice"/>
159+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductName">
160+
<argument name="index" value="1"/>
161+
<argument name="attribute" value="Product"/>
162+
<argument name="value" value="$$createFirstConfigProduct.name$$"/>
163+
</actionGroup>
164+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductPrice">
165+
<argument name="index" value="1"/>
166+
<argument name="attribute" value="Price"/>
167+
<argument name="value" value="$123.00"/>
168+
</actionGroup>
169+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductName">
170+
<argument name="index" value="2"/>
171+
<argument name="attribute" value="Product"/>
172+
<argument name="value" value="$$createSecondConfigProduct.name$$"/>
173+
</actionGroup>
174+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductPrice">
175+
<argument name="index" value="2"/>
176+
<argument name="attribute" value="Price"/>
177+
<argument name="value" value="$123.00"/>
178+
</actionGroup>
163179
</test>
164180
</tests>

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,15 @@
109109
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>
110110

111111
<!-- Assert product in items ordered grid -->
112-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/>
113-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeProductPrice"/>
112+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
113+
<argument name="index" value="1"/>
114+
<argument name="attribute" value="Product"/>
115+
<argument name="value" value="$$createConfigProduct.name$$"/>
116+
</actionGroup>
117+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
118+
<argument name="index" value="1"/>
119+
<argument name="attribute" value="Price"/>
120+
<argument name="value" value="$123.00"/>
121+
</actionGroup>
114122
</test>
115123
</tests>

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@
5959
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>
6060

6161
<!-- 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"/>
62+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
63+
<argument name="index" value="1"/>
64+
<argument name="attribute" value="Product"/>
65+
<argument name="value" value="$$createProduct.name$$"/>
66+
</actionGroup>
67+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
68+
<argument name="index" value="1"/>
69+
<argument name="attribute" value="Price"/>
70+
<argument name="value" value="$$createProduct.price$$"/>
71+
</actionGroup>
6472
</test>
6573
</tests>

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

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,19 @@
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"/>
2826

29-
<!-- Create category -->
3027
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
3128

32-
<!-- Create simple products -->
3329
<createData entity="SimpleProduct2" stepKey="createFirstProduct">
3430
<field key="price">755.00</field>
3531
</createData>
3632
<createData entity="SimpleProduct2" stepKey="createSecondProduct">
3733
<field key="price">756.00</field>
3834
</createData>
3935

40-
<!-- Create Bundle product -->
4136
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct">
4237
<requiredEntity createDataKey="createCategory"/>
4338
</createData>
@@ -54,41 +49,35 @@
5449
<requiredEntity createDataKey="createBundleOption"/>
5550
<requiredEntity createDataKey="createSecondProduct"/>
5651
</createData>
57-
<!-- Change configuration -->
52+
5853
<magentoCLI command="config:set reports/options/enabled 1" stepKey="enableReportModule"/>
5954

6055
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
6156
</before>
6257
<after>
63-
<!-- Admin logout -->
6458
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
6559

66-
<!-- Customer logout -->
6760
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
6861

69-
<!-- Delete customer -->
7062
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
7163

72-
<!-- Delete created product data -->
7364
<deleteData createDataKey="createBundleProduct" stepKey="deleteProduct"/>
7465
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
7566
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
7667

77-
<!-- Delete category -->
7868
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
7969

80-
<!-- Change configuration -->
8170
<magentoCLI command="config:set reports/options/enabled 0" stepKey="disableReportModule"/>
8271
</after>
8372

84-
<!-- Login as customer -->
8573
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
8674
<argument name="Customer" value="$$createCustomer$$"/>
8775
</actionGroup>
8876

89-
<!-- Go to created product page -->
90-
<amOnPage url="{{StorefrontProductPage.url($$createBundleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
91-
<waitForPageLoad stepKey="waitForProductPageLoad"/>
77+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
78+
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
79+
</actionGroup>
80+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductPageLoad"/>
9281

9382
<!-- Search and open customer -->
9483
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
@@ -97,20 +86,29 @@
9786
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/>
9887
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/>
9988

100-
<!-- Click create order -->
101-
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
89+
<actionGroup ref="AdminClickCreateOrderOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/>
90+
91+
<actionGroup ref="AdminClickConfigureForRecentlyViewedProductActionGroup" stepKey="configureProduct">
92+
<argument name="productName" value="$$createBundleProduct.name$$"/>
93+
</actionGroup>
94+
<actionGroup ref="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup" stepKey="selectProductOption">
95+
<argument name="optionName" value="$$createFirstProduct.name$$"/>
96+
</actionGroup>
10297

103-
<!-- Add configure to bundle product -->
104-
<click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure($$createBundleProduct.name$$)}}" stepKey="configureProduct"/>
105-
<click selector="{{AdminCustomerActivitiesConfigureSection.dropdownProductSelection($$createFirstProduct.name$$)}}" stepKey="selectProductOption"/>
106-
<click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtn"/>
107-
<waitForPageLoad stepKey="waitForAddingConfigure"/>
98+
<actionGroup ref="AdminClickOkOnConfigureProductSlidingModalActionGroup" stepKey="clickOkBtn"/>
99+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForAddingConfigure"/>
108100

109-
<!-- Click 'Update Changes' -->
110101
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>
111102

112-
<!-- Assert products in items ordered grid -->
113-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createBundleProduct.name$$" stepKey="seeProductName"/>
114-
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$755.00" stepKey="seeProductPrice"/>
103+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
104+
<argument name="index" value="1"/>
105+
<argument name="attribute" value="Product"/>
106+
<argument name="value" value="$$createBundleProduct.name$$"/>
107+
</actionGroup>
108+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
109+
<argument name="index" value="1"/>
110+
<argument name="attribute" value="Price"/>
111+
<argument name="value" value="$755.00"/>
112+
</actionGroup>
115113
</test>
116114
</tests>

0 commit comments

Comments
 (0)