Skip to content

Commit f3e1661

Browse files
authored
Merge pull request #7965 from magento-gl/functional_testing_automation_ver1
[Bengals] MFTF Automation
2 parents 8ef004d + 9cdfd3e commit f3e1661

13 files changed

+301
-2
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginSuccessfulTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
<group value="example"/>
2020
<group value="login"/>
2121
</annotations>
22-
23-
2422
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2523
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
2624
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>

app/code/Magento/Bundle/Test/Mftf/ActionGroup/SetBundleProductAttributesActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<checkOption selector="{{AdminProductFormBundleSection.dynamicWeightToggle}}" stepKey="dynamicWeight"/>
6161

6262
<!--Weight-->
63+
<scrollTo selector="{{AdminProductFormBundleSection.weightFieldLabel}}" stepKey="scrollToWeight"/>
6364
<fillField selector="{{AdminProductFormBundleSection.weightField}}" userInput="{{weight}}" stepKey="fillIn"/>
6465

6566
<!--Visibility-->

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@
124124
<element name="customizableOptionPrice" type="input" selector=".//*[@name='product[options][0][price]']" />
125125
<element name="priceType" type="select" selector="[name='product[options][0][price_type]']" />
126126
<element name="priceTypeSelectPercent" type="select" selector="//*[@name='product[options][0][price_type]']/option[2]" />
127+
<element name="weightFieldLabel" type="input" selector="//div[@data-index='weight']/div/label/span"/>
127128
</section>
128129
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@
4343
<element name="searchStore" type="input" selector="//div/input[@id='search']" />
4444
<element name="productAttributeName" type="button" selector="//div[@class='filter-options-title' and contains(text(),'{{var1}}')]" parameterized="true"/>
4545
<element name="productAttributeOptionValue" type="button" selector="//div[@id='narrow-by-list']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
46+
<element name="outOfStockProductCategoryPage" type="text" selector="//div[@class='stock unavailable']//span[text()='Out of stock']"/>
4647
</section>
4748
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="sortByDropdown" type="select" selector=".//*[@class='toolbar toolbar-products'][1]//*[@id='sorter']" timeout="30"/>
1515
<element name="sortDirectionAsc" type="button" selector=".//*[@class='toolbar toolbar-products'][1]//a[contains(@class, 'sort-asc')]" timeout="30"/>
1616
<element name="sortDirectionDesc" type="button" selector=".//*[@class='toolbar toolbar-products'][1]//a[contains(@class, 'sort-desc')]" timeout="30"/>
17+
<element name="showDropdown" type="select" selector="//*[@id='limiter']" timeout="30"/>
1718
</section>
1819
</sections>
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminChangeCategoryDisplaySettingsOnStorefrontTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="ChangeCategoryDisplaySettingsOnStorefront"/>
14+
<title value="Verify correctness of Sorting,Navigation, Listing products"/>
15+
<description value="Verify correctness of Sorting, Navigation, Listing products at the Storefront Category"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-4150"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<!-- create category -->
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<!-- create 11 simple products -->
24+
<createData entity="SimpleProduct" stepKey="createSimpleProduct1">
25+
<field key="price">10</field>
26+
<field key="quantity">1000</field>
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<createData entity="SimpleProduct" stepKey="createSimpleProduct2">
30+
<field key="price">11</field>
31+
<field key="quantity">1000</field>
32+
<requiredEntity createDataKey="createCategory"/>
33+
</createData>
34+
<createData entity="SimpleProduct" stepKey="createSimpleProduct3">
35+
<field key="price">12</field>
36+
<field key="quantity">1000</field>
37+
<requiredEntity createDataKey="createCategory"/>
38+
</createData>
39+
<createData entity="SimpleProduct" stepKey="createSimpleProduct4">
40+
<field key="price">13</field>
41+
<field key="quantity">1000</field>
42+
<requiredEntity createDataKey="createCategory"/>
43+
</createData>
44+
<createData entity="SimpleProduct" stepKey="createSimpleProduct5">
45+
<field key="price">14</field>
46+
<field key="quantity">1000</field>
47+
<requiredEntity createDataKey="createCategory"/>
48+
</createData>
49+
<createData entity="SimpleProduct" stepKey="createSimpleProduct6">
50+
<field key="price">15</field>
51+
<field key="quantity">1000</field>
52+
<requiredEntity createDataKey="createCategory"/>
53+
</createData>
54+
<createData entity="SimpleProduct" stepKey="createSimpleProduct7">
55+
<field key="price">16</field>
56+
<field key="quantity">1000</field>
57+
<requiredEntity createDataKey="createCategory"/>
58+
</createData>
59+
<createData entity="SimpleProduct" stepKey="createSimpleProduct8">
60+
<field key="price">17</field>
61+
<field key="quantity">1000</field>
62+
<requiredEntity createDataKey="createCategory"/>
63+
</createData>
64+
<createData entity="SimpleProduct" stepKey="createSimpleProduct9">
65+
<field key="price">18</field>
66+
<field key="quantity">1000</field>
67+
<requiredEntity createDataKey="createCategory"/>
68+
</createData>
69+
<createData entity="SimpleProduct" stepKey="createSimpleProduct10">
70+
<field key="price">19</field>
71+
<field key="quantity">1000</field>
72+
<requiredEntity createDataKey="createCategory"/>
73+
</createData>
74+
<createData entity="SimpleProduct" stepKey="createSimpleProduct11">
75+
<field key="price">20</field>
76+
<field key="quantity">1000</field>
77+
<requiredEntity createDataKey="createCategory"/>
78+
</createData>
79+
<createData entity="SimpleProduct" stepKey="createSimpleProduct12">
80+
<field key="price">21</field>
81+
<field key="quantity">1000</field>
82+
<requiredEntity createDataKey="createCategory"/>
83+
</createData><createData entity="SimpleProduct" stepKey="createSimpleProduct13">
84+
<field key="price">22</field>
85+
<field key="quantity">1000</field>
86+
<requiredEntity createDataKey="createCategory"/>
87+
</createData><createData entity="SimpleProduct" stepKey="createSimpleProduct14">
88+
<field key="price">23</field>
89+
<field key="quantity">1000</field>
90+
<requiredEntity createDataKey="createCategory"/>
91+
</createData><createData entity="SimpleProduct" stepKey="createSimpleProduct15">
92+
<field key="price">24</field>
93+
<field key="quantity">1000</field>
94+
<requiredEntity createDataKey="createCategory"/>
95+
</createData>
96+
</before>
97+
<after>
98+
<!-- delete created entities -->
99+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
100+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
101+
<deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/>
102+
<deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/>
103+
<deleteData createDataKey="createSimpleProduct5" stepKey="deleteSimpleProduct5"/>
104+
<deleteData createDataKey="createSimpleProduct6" stepKey="deleteSimpleProduct6"/>
105+
<deleteData createDataKey="createSimpleProduct7" stepKey="deleteSimpleProduct7"/>
106+
<deleteData createDataKey="createSimpleProduct8" stepKey="deleteSimpleProduct8"/>
107+
<deleteData createDataKey="createSimpleProduct9" stepKey="deleteSimpleProduct9"/>
108+
<deleteData createDataKey="createSimpleProduct10" stepKey="deleteSimpleProduct10"/>
109+
<deleteData createDataKey="createSimpleProduct11" stepKey="deleteSimpleProduct11"/>
110+
<deleteData createDataKey="createSimpleProduct12" stepKey="deleteSimpleProduct12"/>
111+
<deleteData createDataKey="createSimpleProduct13" stepKey="deleteSimpleProduct13"/>
112+
<deleteData createDataKey="createSimpleProduct14" stepKey="deleteSimpleProduct14"/>
113+
<deleteData createDataKey="createSimpleProduct15" stepKey="deleteSimpleProduct15"/>
114+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
115+
</after>
116+
<!-- Login to Admin page -->
117+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
118+
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
119+
<!-- Open created category on Storefront -->
120+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
121+
<argument name="categoryName" value="$$createCategory.name$$"/>
122+
</actionGroup>
123+
<!-- Switch category view to List mode -->
124+
<actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/>
125+
<!-- Sort products By Price -->
126+
<actionGroup ref="StorefrontCategoryPageSortProductActionGroup" stepKey="sortProductByPrice"/>
127+
<!-- Set Ascending Direction -->
128+
<actionGroup ref="StorefrontCategoryPageSortAscendingActionGroup" stepKey="setAscendingDirection"/>
129+
<!-- Sort products By ProductName -->
130+
<selectOption selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" userInput="Product Name" stepKey="selectSortByProductName"/>
131+
<!-- Set Descending Direction -->
132+
<actionGroup ref="StorefrontCategoryPageSortDescendingActionGroup" stepKey="setDescendingDirection"/>
133+
<selectOption selector="{{StorefrontCategoryTopToolbarSection.showDropdown}}" userInput="15" stepKey="selectShowProducts"/>
134+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
135+
</test>
136+
</tests>
137+
138+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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="StoreFrontAddOutOfStockProductToShoppingCartTest">
12+
<annotations>
13+
<features value="[Disabled Inventory Check] Add Out of Stock Product to the Shopping Cart"/>
14+
<stories value="[Disabled Inventory Check] Add Out of Stock Product to the Shopping Cart"/>
15+
<title value="Checking Add Out of Stock Products to the Shopping Cart"/>
16+
<description value="Placing the order for out of stock products and zero quantity"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-5262"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Set Enable Inventory Check On Cart Load = No -->
23+
<magentoCLI command="config:set {{DisableInventoryCheckOnCartLoad.path}} {{DisableInventoryCheckOnCartLoad.value}}" stepKey="disableCartLoad"/>
24+
<!-- Create default category with subcategory -->
25+
<createData entity="ApiCategory" stepKey="createCategory"/>
26+
<createData entity="SubCategoryWithParent" stepKey="createSubcategory">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<!-- Create SimpleProductwithPrice100 -->
30+
<createData entity="SimpleProductQty100" stepKey="simpleProductOne">
31+
<requiredEntity createDataKey="createSubcategory"/>
32+
</createData>
33+
<!-- Go To Subcategory Page-->
34+
<actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="goToCategoryC">
35+
<argument name="categoryName" value="$$createCategory.name$$"/>
36+
<argument name="subCategoryName" value="$$createSubcategory.name$$"/>
37+
</actionGroup>
38+
</before>
39+
<!-- Delete the Data after execution-->
40+
<after>
41+
<deleteData createDataKey="createCategory" stepKey="deleteProduct"/>
42+
<deleteData createDataKey="simpleProductOne" stepKey="deleteCategory"/>
43+
<magentoCLI command="config:set {{EnableInventoryCheckOnCartLoad.path}} {{EnableInventoryCheckOnCartLoad.value}}" stepKey="enableCartLoad"/>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
45+
</after>
46+
<!-- Open New tab-->
47+
<openNewTab stepKey="openNewTab"/>
48+
<!-- Open Product From AdminPage-->
49+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
50+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPageinNewTab">
51+
<argument name="productId" value="$simpleProductOne.id$"/>
52+
</actionGroup>
53+
<!-- Set Stock Status of Product to Out Of Stock-->
54+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus">
55+
<argument name="stockStatus" value="Out of Stock"/>
56+
</actionGroup>
57+
<!-- Save Product-->
58+
<actionGroup ref="SaveProductFormActionGroup" stepKey="clicksaveProduct"/>
59+
<!-- Switch to Previous tab and Check Error message Product that you are trying to add is not available -->
60+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
61+
<!-- Mouse Hover Product On Category Page-->
62+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
63+
<!-- Select Add to cart-->
64+
<click selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="toCategory"/>
65+
<waitForPageLoad stepKey="wait"/>
66+
<!-- Assert the Error Message-->
67+
<see selector="{{StorefrontProductPageSection.errorMsg}}" userInput="Product that you are trying to add is not available." stepKey="seeErrorMessage"/>
68+
</test>
69+
70+
</tests>

app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@
3434
<element name="massActionsOption" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//span[contains(@class, 'action-menu-item') and .= '{{action}}']" parameterized="true"/>
3535
<element name="gridDataRow" type="input" selector=".data-row .data-grid-cell-content"/>
3636
<element name="pagesGridRowByTitle" type="input" selector="//tbody//tr//td//div[contains(., '{{var1}}')]" parameterized="true" timeout="30"/>
37+
<element name="saveFormRow" type="button" selector="//td//button//span[contains(text(),'Save')]/.."/>
38+
<element name="selectLayout" type="select" selector="//tr[@class='data-grid-editable-row _odd-row']//select[@name='page_layout']" />
3739
</section>
3840
</sections>

app/code/Magento/Directory/Test/Mftf/Test/CustomCurrencySymbolWithSpaceTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<testCaseId value="AC-6031" />
1919
<useCaseId value="ACP2E-1012"/>
2020
<group value="currency"/>
21+
<skip>
22+
<issueId value="ACQE-4266"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/MediaGalleryUi/Test/Mftf/Section/AdminMediaGalleryFolderSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMediaGalleryFolderSection">
12+
1213
<element name="folderNewModalHeader" type="block" selector="//h1[contains(text(), 'New Folder Name')]"/>
1314
<element name="folderDeleteModalHeader" type="block" selector="//h1[contains(text(), 'Are you sure you want to delete this folder?')]"/>
1415
<element name="folderNewCreateButton" type="button" selector="#create_folder"/>
@@ -28,5 +29,7 @@
2829
<element name="activeDeleteFolderButton" type="button" selector="//h1[@class='modal-title' and contains(text(),'Insert File')]/../..//button[@id='delete_folder']"/>
2930
<element name="folderDeleteMessageTitle" type="block" selector="//h1[@class='modal-title' and contains(text(),'Are you sure you want to delete this folder?')]"/>
3031
<element name="folderDeleteMessageContent" type="block" selector="//div[@class='modal-content']//div[contains(text(),'The following folder is going to be deleted: wysiwyg/{{arg}}')]" parameterized="true"/>
32+
3133
</section>
3234
</sections>
35+

0 commit comments

Comments
 (0)