Skip to content

Commit 97e3454

Browse files
committed
Refactored AdminMassProductPriceUpdateTest
1 parent f55f411 commit 97e3454

File tree

3 files changed

+81
-13
lines changed

3 files changed

+81
-13
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="AdminCheckProductOnProductGridActionGroup">
12+
<annotations>
13+
<description>Check the product on the Product Grid</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminSetPriceForMassUpdateActionGroup">
12+
<annotations>
13+
<description>Click the "Change" checkbox for the "Price" field. Set new price.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="price" type="string"/>
17+
</arguments>
18+
19+
<scrollTo stepKey="scrollToPriceCheckBox" selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" x="0" y="-160"/>
20+
<click selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" stepKey="selectPriceCheckBox"/>
21+
<fillField stepKey="fillPrice" selector="{{AdminEditProductAttributesSection.AttributePrice}}" userInput="{{price}}"/>
22+
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,27 @@
4141
<actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/>
4242

4343
<!--Select products-->
44-
<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku($$simpleProduct1.sku$$)}}" stepKey="selectFirstProduct"/>
45-
<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku($$simpleProduct2.sku$$)}}" stepKey="selectSecondProduct"/>
44+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectFirstProduct">
45+
<argument name="product" value="$simpleProduct1$"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectSecondProduct">
48+
<argument name="product" value="$simpleProduct2$"/>
49+
</actionGroup>
4650

4751
<!-- Update product price-->
48-
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
49-
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickChangeStatus"/>
50-
<waitForPageLoad stepKey="waitForProductAttributePageToLoad"/>
51-
<scrollTo stepKey="scrollToPriceCheckBox" selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" x="0" y="-160"/>
52-
<click selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" stepKey="selectPriceCheckBox"/>
53-
<fillField stepKey="fillPrice" selector="{{AdminEditProductAttributesSection.AttributePrice}}" userInput="90.99"/>
54-
<click stepKey="clickOnSaveButton" selector="{{AdminEditProductAttributesSection.Save}}"/>
55-
<waitForPageLoad stepKey="waitForUpdatedProductToSave" />
56-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/>
52+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/>
53+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickChangeStatus"/>
54+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductAttributePageToLoad"/>
55+
56+
<actionGroup ref="AdminSetPriceForMassUpdateActionGroup" stepKey="scrollToPriceCheckBox">
57+
<argument name="price" value="90.99"/>
58+
</actionGroup>
59+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectPriceCheckBox"/>
60+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillPrice"/>
61+
62+
<actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="clickOnSaveButton"/>
63+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForUpdatedProductToSave"/>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAttributeUpateSuccessMsg"/>
5765

5866
<!-- Start message queue -->
5967
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueueConsumer">
@@ -64,7 +72,21 @@
6472
<magentoCLI command="cron:run --group=index" stepKey="runCron"/>
6573

6674
<!--Verify product name, sku and updated price-->
67-
<click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$simpleProduct1.sku$$)}}"/>
75+
<!-- <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstProductEditPage">
76+
<argument name="productId" value="$$simpleProduct1.id$$"/>
77+
</actionGroup> -->
78+
<actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="waitForFirstProductToLoad">
79+
<argument name="product" value="$$simpleProduct1$$"/>
80+
</actionGroup>
81+
82+
<!-- <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondProductEditPage">
83+
<argument name="productId" value="$$simpleProduct2.id$$"/>
84+
</actionGroup> -->
85+
<actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="waitForSecondProductToLoad">
86+
<argument name="product" value="$$simpleProduct2$$"/>
87+
</actionGroup>
88+
89+
<!-- <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$simpleProduct1.sku$$)}}"/>
6890
<waitForPageLoad stepKey="waitForFirstProductToLoad"/>
6991
<seeInField stepKey="seeFirstProductNameInField" selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct1.name$$"/>
7092
<seeInField stepKey="seeFirstProductSkuInField" selector="{{AdminProductFormSection.productSku}}" userInput="$$simpleProduct1.sku$$"/>
@@ -75,6 +97,6 @@
7597
<waitForPageLoad stepKey="waitForSecondProductToLoad"/>
7698
<seeInField stepKey="seeSecondProductNameInField" selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct2.name$$"/>
7799
<seeInField stepKey="seeSecondProductSkuInField" selector="{{AdminProductFormSection.productSku}}" userInput="$$simpleProduct2.sku$$"/>
78-
<seeInField stepKey="seeSecondProductPriceInField" selector="{{AdminProductFormSection.productPrice}}" userInput="90.99"/>
100+
<seeInField stepKey="seeSecondProductPriceInField" selector="{{AdminProductFormSection.productPrice}}" userInput="90.99"/> -->
79101
</test>
80102
</tests>

0 commit comments

Comments
 (0)