Skip to content

Commit 131cd1a

Browse files
committed
Refactored AdminMassProductPriceUpdateTest
1 parent 97e3454 commit 131cd1a

File tree

2 files changed

+45
-34
lines changed

2 files changed

+45
-34
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AssertAdminProductPriceUpdatedOnEditPageActionGroup" extends="OpenEditProductOnBackendActionGroup">
12+
<annotations>
13+
<description>Validate if Product price is updated on the Product creation/edit page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
<argument name="price" type="string"/>
18+
</arguments>
19+
20+
<waitForPageLoad stepKey="waitForProductToLoad"/>
21+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/>
22+
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/>
23+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{price}}" stepKey="seeProductPrice"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,23 @@
2525
</before>
2626
<after>
2727
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
28-
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
28+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
2929
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3030
</after>
3131

32-
<!--Open Product Index Page-->
3332
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
3433

35-
<!--Search products using keyword -->
36-
<actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword">
37-
<argument name="keyword" value="Testp"/>
38-
</actionGroup>
34+
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="searchByKeyword"/>
3935

40-
<!--Sort Products by ID in descending order-->
4136
<actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/>
4237

43-
<!--Select products-->
4438
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectFirstProduct">
4539
<argument name="product" value="$simpleProduct1$"/>
4640
</actionGroup>
4741
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="selectSecondProduct">
4842
<argument name="product" value="$simpleProduct2$"/>
4943
</actionGroup>
5044

51-
<!-- Update product price-->
5245
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/>
5346
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickChangeStatus"/>
5447
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductAttributePageToLoad"/>
@@ -63,40 +56,33 @@
6356
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForUpdatedProductToSave"/>
6457
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAttributeUpateSuccessMsg"/>
6558

66-
<!-- Start message queue -->
6759
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueueConsumer">
6860
<argument name="consumerName" value="{{AdminProductAttributeUpdateConsumerData.consumerName}}"/>
6961
<argument name="maxMessages" value="{{AdminProductAttributeUpdateConsumerData.messageLimit}}"/>
7062
</actionGroup>
71-
<!-- Run cron -->
63+
7264
<magentoCLI command="cron:run --group=index" stepKey="runCron"/>
7365

74-
<!--Verify product name, sku and updated price-->
75-
<!-- <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstProductEditPage">
76-
<argument name="productId" value="$$simpleProduct1.id$$"/>
77-
</actionGroup> -->
78-
<actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="waitForFirstProductToLoad">
66+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openFirstProduct"/>
67+
<actionGroup ref="AssertAdminProductPriceUpdatedOnEditPageActionGroup" stepKey="waitForFirstProductToLoad">
7968
<argument name="product" value="$$simpleProduct1$$"/>
69+
<argument name="price" value="90.99"/>
8070
</actionGroup>
71+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeFirstProductNameInField"/>
72+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeFirstProductSkuInField"/>
73+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeFirstProductPriceInField"/>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnBackButton"/>
8175

82-
<!-- <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondProductEditPage">
83-
<argument name="productId" value="$$simpleProduct2.id$$"/>
84-
</actionGroup> -->
85-
<actionGroup ref="AssertProductInfoOnEditPageActionGroup" stepKey="waitForSecondProductToLoad">
76+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="waitForProductsToLoad"/>
77+
78+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openSecondProduct"/>
79+
<actionGroup ref="AssertAdminProductPriceUpdatedOnEditPageActionGroup" stepKey="waitForSecondProductToLoad">
8680
<argument name="product" value="$$simpleProduct2$$"/>
87-
</actionGroup>
88-
89-
<!-- <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$simpleProduct1.sku$$)}}"/>
90-
<waitForPageLoad stepKey="waitForFirstProductToLoad"/>
91-
<seeInField stepKey="seeFirstProductNameInField" selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct1.name$$"/>
92-
<seeInField stepKey="seeFirstProductSkuInField" selector="{{AdminProductFormSection.productSku}}" userInput="$$simpleProduct1.sku$$"/>
93-
<seeInField stepKey="seeFirstProductPriceInField" selector="{{AdminProductFormSection.productPrice}}" userInput="90.99"/>
94-
<click stepKey="clickOnBackButton" selector="{{AdminGridMainControls.back}}"/>
95-
<waitForPageLoad stepKey="waitForProductsToLoad"/>
96-
<click stepKey="openSecondProduct" selector="{{AdminProductGridSection.productRowBySku($$simpleProduct2.sku$$)}}"/>
97-
<waitForPageLoad stepKey="waitForSecondProductToLoad"/>
98-
<seeInField stepKey="seeSecondProductNameInField" selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct2.name$$"/>
99-
<seeInField stepKey="seeSecondProductSkuInField" selector="{{AdminProductFormSection.productSku}}" userInput="$$simpleProduct2.sku$$"/>
100-
<seeInField stepKey="seeSecondProductPriceInField" selector="{{AdminProductFormSection.productPrice}}" userInput="90.99"/> -->
81+
<argument name="price" value="90.99"/>
82+
</actionGroup>
83+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSecondProductNameInField"/>
84+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSecondProductSkuInField"/>
85+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSecondProductPriceInField"/>
86+
10187
</test>
10288
</tests>

0 commit comments

Comments
 (0)