Skip to content

Commit 3a25a26

Browse files
authored
Merge pull request #7867 from magento-gl/functional--test--automation
[Bengals] MFTF Automation Phase 1
2 parents 2605796 + 87d338b commit 3a25a26

File tree

27 files changed

+949
-3
lines changed

27 files changed

+949
-3
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+

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProducRelatedProductsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="relatedProductsListSectionText" type="text" selector=".block.related .products.wrapper.grid.products-grid.products-related" />
1515
<element name="relatedProductName" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]" parameterized="true"/>
1616
<element name="relatedProductCheckBoxButton" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]/parent::*/parent::*//input[@class='checkbox related']" parameterized="true"/>
17+
<element name="selectAll" type="button" selector="//div[@class='block-actions']/button"/>
1718
</section>
1819
</sections>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAddAndUpdateCustomGroupInAttributeSetTest">
12+
<annotations>
13+
<stories value="Edit attribute set"/>
14+
<title value="Add and Update a custom group in an Attribute Set"/>
15+
<description value="Create a new group. Assign/unassign attributes to/from it"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-26919"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
22+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
23+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
24+
</before>
25+
<after>
26+
27+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
28+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
</after>
31+
32+
33+
<!-- Navigate to Stores > Attributes > Attribute Set -->
34+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
35+
<waitForPageLoad stepKey="waitForPageLoad"/>
36+
37+
<!-- Search and open Attribute Set from preconditions -->
38+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute">
39+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
40+
</actionGroup>
41+
42+
<!-- Click 'Add New': Show 'New Group' Modal -->
43+
<click selector="{{AdminProductAttributeSetEditSection.AddNewGroup}}" stepKey="clickAddNew"/>
44+
<waitForAjaxLoad stepKey="waitForAjax"/>
45+
46+
<!-- Fill 'name' for new group and click 'Ok': Name = <empty> -->
47+
<fillField userInput="" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillName"/>
48+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickOk"/>
49+
50+
<!-- Error message 'This is a required field.' is displayed -->
51+
<see userInput="This is a required field." selector="{{AdminProductAttributeSetEditSection.errorLabel}}" stepKey="seeErrorMessage"/>
52+
53+
<!-- Fill 'name' for new group and click 'Ok': Name = Custom group -->
54+
<fillField userInput="{{customGroup.name}}" selector="{{AdminProductAttributeSetEditSection.newGroupName}}" stepKey="fillCustomGroupName"/>
55+
<click selector="{{AdminProductAttributeSetEditSection.buttonOk}}" stepKey="clickButtonOk1"/>
56+
57+
<!-- Group is created and displayed in 'Groups' block -->
58+
<seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(customGroup.name)}}" stepKey="assertCustomGroup"/>
59+
60+
<!-- Move custom Product Attribute to new 'Custom group' Group -->
61+
62+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
63+
<click selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="clickButtonOk"/>
64+
<waitForPageLoad stepKey="waitForPageLoadAfterClick"/>
65+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute($$createConfigProductAttribute.attribute_code$$)}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="moveAttribute"/>
66+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
67+
<dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute('custom_layout')}}" selector2="{{AdminProductAttributeSetEditSection.attributeGroupExtender(customGroup.name)}}" stepKey="dragAndDrop"/>
68+
<waitForPageLoad stepKey="waitForDragAndDrop1"/>
69+
<!-- Click 'Save' -->
70+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
71+
<!-- Navigate to Catalog > Products -->
72+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>
73+
<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
74+
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
75+
<waitForPageLoad stepKey="waitForNewProductPage"/>
76+
77+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute">
78+
<argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/>
79+
</actionGroup>
80+
81+
<!-- New Section 'Custom group' is present in form. The section contains the attribute from preconditions -->
82+
<seeElement selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="seeSectionCustomGroup"/>
83+
<click selector="{{AdminProductAttributeSection.attributeGroupByName(customGroup.name)}}" stepKey="openCustomGroupSection"/>
84+
<waitForAjaxLoad stepKey="waitForOpenSection"/>
85+
<scrollTo selector="{{AdminProductFormSection.footerBlock}}" stepKey="scrollToFooter"/>
86+
<seeElement selector="{{AdminProductAttributeSection.attributeByGroupAndName(customGroup.name)}}" stepKey="seeAttributePresent"/>
87+
88+
</test>
89+
</tests>
90+
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>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminChangeArrangementOfAttributesInAnAttributeSetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="change order of the attributes"/>
15+
<title value="Admin should be able to Verify that it's possible to change order of the attributes"/>
16+
<description value="Admin should be able to Verify that it's possible to change order of the attributes"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-26810"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Create a custom attribute set and custom product attribute -->
23+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
24+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
25+
26+
</before>
27+
<after>
28+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
29+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
30+
31+
</after>
32+
<!-- Login to Admin -->
33+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
34+
35+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
36+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
37+
38+
<!-- Navigate to Stores > Attributes > Attribute Set -->
39+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
40+
<waitForPageLoad stepKey="waitForPageLoad"/>
41+
42+
<!-- Search and open Attribute Set from preconditions -->
43+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute">
44+
<argument name="name" value="$$createAttributeSet.attribute_set_name$$"/>
45+
</actionGroup>
46+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute('weight')}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemAttributeGroup('Product Details', '6')}}" stepKey="dragAndDrop1"/>
47+
<wait stepKey="waitPostDragAndDrop" time="10"/>
48+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/>
49+
<!-- Navigate to Catalog > Products -->
50+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>
51+
52+
<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
53+
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
54+
<waitForPageLoad stepKey="waitForNewProductPage"/>
55+
56+
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute">
57+
<argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/>
58+
</actionGroup>
59+
</test>
60+
</tests>
61+

0 commit comments

Comments
 (0)