Skip to content

Commit cff58b1

Browse files
authored
ENGCOM-9244: [MFTF] MoveRecentlyViewedBundleFixedProductOnOrderPageTest refactoring #34249
2 parents 93cce98 + d371f56 commit cff58b1

6 files changed

+132
-28
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/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml

Lines changed: 25 additions & 28 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,63 +49,65 @@
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

93-
<!-- Search and open customer -->
9482
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
9583
<argument name="customerId" value="$createCustomer.id$"/>
9684
</actionGroup>
9785
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/>
9886
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/>
9987

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

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"/>
97+
<actionGroup ref="AdminClickOkOnConfigureProductSlidingModalActionGroup" stepKey="clickOkBtn"/>
98+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForAddingConfigure"/>
10899

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

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"/>
102+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
103+
<argument name="index" value="1"/>
104+
<argument name="attribute" value="Product"/>
105+
<argument name="value" value="$$createBundleProduct.name$$"/>
106+
</actionGroup>
107+
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
108+
<argument name="index" value="1"/>
109+
<argument name="attribute" value="Price"/>
110+
<argument name="value" value="$755.00"/>
111+
</actionGroup>
115112
</test>
116113
</tests>

0 commit comments

Comments
 (0)