Skip to content

Commit ef5cd8c

Browse files
committed
refactored MoveRecentlyViewedBundleFixedProductOnOrderPageTest
1 parent 5788e74 commit ef5cd8c

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,62 +49,64 @@
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="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer">
9583
<argument name="email" value="$$createCustomer.email$$"/>
9684
</actionGroup>
9785
<actionGroup ref="AdminClickFirstRowEditLinkOnCustomerGridActionGroup" stepKey="clickEditButton"/>
9886

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

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

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

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

0 commit comments

Comments
 (0)