Skip to content

Commit 736554e

Browse files
ENGCOM-8533: [MFTF] Refactoring of AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest #31221
- Merge Pull Request #31221 from AnnaAPak/magento2:ref-AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest - Merged commits: 1. fe6298b 2. e4fde6b 3. 1dd1046 4. 706e63d 5. f6db4a7
2 parents ad29452 + f6db4a7 commit 736554e

9 files changed

+274
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AdminAssignTwoCategoriesToProductActionGroup" extends="AdminAssignCategoryToProductAndSaveActionGroup">
12+
<annotations>
13+
<description>Extends AdminAssignCategoryToProductAndSaveActionGroup + assigns the second category and prevents product saving (the Product Edit page should be opened in Admin prior this check).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryTwoName" type="string"/>
17+
</arguments>
18+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown2" after="waitForApplyCategory"/>
19+
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryTwoName)}}" stepKey="selectCategoryTwo"/>
20+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone2"/>
21+
<waitForPageLoad stepKey="waitForApplyCategoryTwo"/>
22+
<remove keyForRemoval="clickSave"/>
23+
<remove keyForRemoval="waitForSavingProduct"/>
24+
<remove keyForRemoval="seeSuccessMessage"/>
25+
</actionGroup>
26+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminFillMainProductFormActionGroup" extends="FillMainProductFormActionGroup">
12+
<annotations>
13+
<description>Extends FillMainProductFormActionGroup with filling the next fields: Tax Class, Visibility, SEO->URL </description>
14+
</annotations>
15+
16+
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="selectProductTaxClass"/>
17+
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="selectVisibility"/>
18+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
19+
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="fillUrlKey"/>
20+
</actionGroup>
21+
</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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminManageStockOnEditPageActionGroup">
12+
<annotations>
13+
<description>Check if manageStock value is correct
14+
(the Product Edit page->Advanced Inventory section should be opened in Admin prior this check).</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="manageStock" type="string"/>
18+
</arguments>
19+
20+
<see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="seeManageStock"/>
21+
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AssertAdminProductInfoOnEditPageActionGroup">
12+
<annotations>
13+
<description>Validates next fields on the Product Edit Page:
14+
name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="product" type="entity"/>
18+
</arguments>
19+
<waitForPageLoad stepKey="waitForProductToLoad"/>
20+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/>
21+
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/>
22+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="seeProductPrice"/>
23+
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="seeProductQuantity"/>
24+
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="seeProductStockStatus"/>
25+
<seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="seeProductTaxClass"/>
26+
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="seeSimpleProductWeight"/>
27+
<seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{product.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/>
28+
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="seeVisibility"/>
29+
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
30+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
31+
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="seeUrlKey"/>
32+
</actionGroup>
33+
</actionGroups>
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="AssertAdminProductIsAssignedToCategoryActionGroup">
12+
<annotations>
13+
<description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontProductStockStatusOnProductPageActionGroup">
11+
<annotations>
12+
<description>Validates that the provided Product Stock Status is present and correct
13+
(the Product Detail page should be opened on Storefront prior this check)</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productStockStatus" type="string"/>
17+
</arguments>
18+
19+
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@
7777
<element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/>
7878
<element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/>
7979
<element name="footerBlock" type="block" selector="//footer"/>
80+
<element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/>
8081
</section>
8182
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest">
12+
<annotations>
13+
<stories value="Update Simple Product"/>
14+
<title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
15+
<description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
16+
<testCaseId value="MC-10818"/>
17+
<severity value="CRITICAL"/>
18+
<group value="catalog"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<magentoCLI stepKey="setFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 1"/>
24+
<createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/>
25+
<createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct">
26+
<requiredEntity createDataKey="initialCategoryEntity"/>
27+
</createData>
28+
<createData entity="SimpleSubCategory" stepKey="categoryEntity"/>
29+
</before>
30+
<after>
31+
<deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/>
32+
<deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/>
33+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct">
34+
<argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
37+
<magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/>
38+
</after>
39+
40+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
41+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage">
42+
<argument name="product" value="$$initialSimpleProduct$$"/>
43+
</actionGroup>
44+
45+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/>
46+
<actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig">
47+
<argument name="value" value="No"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/>
50+
51+
<actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories">
52+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
53+
<argument name="categoryTwoName" value="$$categoryEntity.name$$"/>
54+
</actionGroup>
55+
56+
<actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo">
57+
<argument name="product" value="simpleProductEnabledFlat"/>
58+
</actionGroup>
59+
60+
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>
61+
62+
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/>
63+
64+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/>
65+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1">
66+
<argument name="product" value="simpleProductEnabledFlat"/>
67+
</actionGroup>
68+
69+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/>
70+
<actionGroup ref="AssertAdminManageStockOnEditPageActionGroup" stepKey="assertManageStock1">
71+
<argument name="manageStock" value="No"/>
72+
</actionGroup>
73+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/>
74+
75+
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory">
76+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
77+
</actionGroup>
78+
79+
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo">
80+
<argument name="categoryName" value="$$categoryEntity.name$$"/>
81+
</actionGroup>
82+
83+
<actionGroup ref="AssertAdminProductInfoOnEditPageActionGroup" stepKey="assertProductInfo">
84+
<argument name="product" value="simpleProductEnabledFlat"/>
85+
</actionGroup>
86+
87+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage">
88+
<argument name="category" value="$categoryEntity$"/>
89+
</actionGroup>
90+
91+
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage">
92+
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/>
93+
</actionGroup>
94+
95+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
96+
<argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/>
97+
</actionGroup>
98+
99+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
100+
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/>
101+
</actionGroup>
102+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
103+
<argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/>
104+
</actionGroup>
105+
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage">
106+
<argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/>
107+
</actionGroup>
108+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage">
109+
<argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/>
110+
</actionGroup>
111+
112+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/>
113+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku">
114+
<argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/>
115+
</actionGroup>
116+
<actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct">
117+
<argument name="productName" value="{{simpleProductEnabledFlat.name}}"/>
118+
<argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/>
119+
</actionGroup>
120+
121+
</test>
122+
</tests>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest">
11+
<test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead">
1212
<annotations>
1313
<stories value="Update Simple Product"/>
14-
<title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
14+
<title value="DEPRECACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
1515
<description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/>
1616
<testCaseId value="MC-10818"/>
1717
<severity value="CRITICAL"/>
1818
<group value="catalog"/>
1919
<group value="mtf_migrated"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

0 commit comments

Comments
 (0)