Skip to content

Commit 50ccdb1

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-2031' into functional--test--automation
2 parents a687732 + 4cfd461 commit 50ccdb1

File tree

3 files changed

+166
-0
lines changed

3 files changed

+166
-0
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminAllIndexerSetUpdateOnSaveActionGroup">
11+
<annotations>
12+
<description>Goes to the Index Management page. Select all Indexers. Selects 'Update on Save'. Clicks on Submit.</description>
13+
</annotations>
14+
15+
<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/>
16+
<waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/>
17+
18+
<selectOption selector="{{AdminIndexManagementSection.selectMassAction}}" userInput="selectAll" stepKey="selectAllOption"/>
19+
<selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/>
20+
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/>
21+
<!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
22+
<waitForPageLoad stepKey="waitForSave2"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 23 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="UpdateAllIndexerByScheduleActionGroup">
11+
<annotations>
12+
<description>Goes to the Index Management page. Select All Indexers. Selects 'Update by Schedule'. Clicks on Submit.</description>
13+
</annotations>
14+
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="amOnIndexManagementPage"/>
15+
<waitForPageLoad stepKey="waitForIndexManagementPageToLoad"/>
16+
<selectOption selector="{{AdminIndexManagementSection.selectMassAction}}" userInput="selectAll" stepKey="selectAllOption"/>
17+
<selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="Update by Schedule" stepKey="selectUpdateBySchedule"/>
18+
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm"/>
19+
<!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
20+
<waitForPageLoad stepKey="waitForSave"/>
21+
</actionGroup>
22+
</actionGroups>
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest">
10+
<annotations>
11+
<features value="Catalog"/>
12+
<stories value="Update price"/>
13+
<title value="Child Product price is updated according to updated prices from backend"/>
14+
<description value="Update the simple product price that is under configurable and validate the updated price in the front end"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-2031"/>
17+
<group value="Catalog"/>
18+
</annotations>
19+
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<actionGroup ref="UpdateAllIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"/>
23+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
24+
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
25+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
26+
</before>
27+
28+
<after>
29+
<deleteData createDataKey="createFirstConfigProduct" stepKey="deleteConfigProduct"/>
30+
<deleteData createDataKey="createFirstConfigFirstChildProduct" stepKey="deleteFirstConfigFirstChildProduct"/>
31+
<deleteData createDataKey="firstSimpleCategory" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/>
33+
<comment userInput="The test was moved to elasticsearch suite" stepKey="resetCatalogSearchConfiguration"/>
34+
<actionGroup ref="AdminAllIndexerSetUpdateOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"/>
35+
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
36+
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
37+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
38+
</after>
39+
40+
<!-- Create category for configurable product -->
41+
<createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/>
42+
43+
<!-- Create configurable product with two options -->
44+
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
45+
<requiredEntity createDataKey="firstSimpleCategory"/>
46+
</createData>
47+
48+
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
49+
50+
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption">
51+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
52+
</createData>
53+
<createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption">
54+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
55+
</createData>
56+
57+
<createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet">
58+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
59+
</createData>
60+
61+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption">
62+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
63+
</getData>
64+
65+
<!-- Create one child product for configurable product -->
66+
<createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct">
67+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
68+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
69+
</createData>
70+
71+
<createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption">
72+
<requiredEntity createDataKey="createFirstConfigProduct"/>
73+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
74+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
75+
</createData>
76+
77+
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild">
78+
<requiredEntity createDataKey="createFirstConfigProduct"/>
79+
<requiredEntity createDataKey="createFirstConfigFirstChildProduct"/>
80+
</createData>
81+
82+
<!-- Assert first product in category -->
83+
<magentoCLI command="cron:run" stepKey="runCron"/>
84+
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront"/>
85+
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad"/>
86+
87+
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory">
88+
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
89+
<argument name="expectedPrice" value="$$createFirstConfigFirstChildProduct.price$$"/>
90+
</actionGroup>
91+
92+
<!-- Search default simple product in grid -->
93+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
94+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/>
95+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
96+
<argument name="product" value="$$createFirstConfigFirstChildProduct$$"/>
97+
</actionGroup>
98+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
99+
100+
<!-- Update default simple product with price -->
101+
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="150" stepKey="fillSimpleProductPrice"/>
102+
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickButtonSave"/>
103+
104+
<!-- Verify customer see success message -->
105+
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
106+
107+
<!-- Assert first product in category -->
108+
<magentoCLI command="cron:run" stepKey="runCron1"/>
109+
<wait time="60" stepKey="waitForUpdateStarts"/>
110+
111+
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront1"/>
112+
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad1"/>
113+
114+
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory1">
115+
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
116+
<argument name="expectedPrice" value="150"/>
117+
</actionGroup>
118+
</test>
119+
</tests>

0 commit comments

Comments
 (0)