Skip to content

Commit 2d2d1d9

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into architecture/action-interface
2 parents f3ca3c2 + 9003079 commit 2d2d1d9

File tree

61 files changed

+2077
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2077
-341
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="AdminAddProductToCategoryActionGroup">
12+
<annotations>
13+
<description>Add Product to Category</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product"/>
17+
</arguments>
18+
19+
<scrollTo selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" x="0" y="-80" stepKey="scrollToProductInCategory"/>
20+
<click selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" stepKey="clickOnProductInCategory"/>
21+
<fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="{{product.name}}" stepKey="selectProduct"/>
22+
<click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/>
23+
<click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
2525
<fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
2626
<fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
27+
<selectOption userInput="{{simpleProduct.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/>
2728
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
2829
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
2930
<fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<element name="RequiredFieldIndicator" type="text" selector=" return window.getComputedStyle(document.querySelector('._required[data-index={{arg1}}]&gt;.admin__field-label span'), ':after').getPropertyValue('content');" parameterized="true"/>
4242
<element name="displayMode" type="button" selector="select[name='display_mode']"/>
4343
<element name="anchor" type="checkbox" selector="input[name='is_anchor']"/>
44+
<element name="anchorLabel" type="text" selector="input[name='is_anchor']+label"/>
4445
<element name="productListCheckBox" type="checkbox" selector="input[name='use_config[available_sort_by]']" />
4546
<element name="productList" type="text" selector="select[name='available_sort_by']"/>
4647
<element name="defaultProductLisCheckBox" type="checkbox" selector="input[name='use_config[default_sort_by]']"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +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="AdminProductMessagesSection">
12-
<element name="successMessage" type="text" selector=".message-success"/>
12+
<element name="successMessage" type="text" selector=".message.message-success.success"/>
1313
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
1414
</section>
1515
</sections>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<waitForPageLoad stepKey="waitForProdAddToCmpList"/>
6161
<!--Assert success message-->
6262
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
63-
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage"/>
63+
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/>
6464
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage"/>
6565
<!--See product in the comparison list-->
6666
<comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/>
@@ -82,7 +82,7 @@
8282
<waitForPageLoad stepKey="waitProdAddingToCmpList"/>
8383
<!--Assert success message-->
8484
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
85-
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage2"/>
85+
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/>
8686
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage2"/>
8787
<!--Check that product displays on add to compare widget-->
8888
<comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
<waitForPageLoad stepKey="waitForPageTitleToBeSaved"/>
6565
<!--Verify the Category Title-->
6666
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />
67+
<grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/>
68+
<!-- Assert Redirect path, Target Path and Redirect type in grid -->
69+
<actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath">
70+
<argument name="redirectPath" value="{{_defaultCategory.name}}.html" />
71+
<argument name="redirectType" value="No" />
72+
<argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/>
73+
</actionGroup>
74+
6775
<!--Clear cache and reindex-->
6876
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
6977
<magentoCLI command="cache:flush" stepKey="flushCache"/>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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="AdminCreateCategoryWithNoAnchorFieldTest">
11+
<annotations>
12+
<stories value="Create categories"/>
13+
<title value="Create no anchor subcategory with all fields"/>
14+
<description value="Login as admin and create no anchor subcategory with all fields"/>
15+
<testCaseId value=""/>
16+
<severity value="CRITICAL"/>
17+
<group value="Catalog"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
22+
<createData entity="_defaultBlock" stepKey="createDefaultCMSBlock"/>
23+
<createData entity="defaultSimpleProduct" stepKey="simpleProduct" />
24+
</before>
25+
<after>
26+
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
<deleteData createDataKey="createDefaultCMSBlock" stepKey="deleteDefaultCMSBlock"/>
29+
<deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/>
30+
</after>
31+
32+
<!--Create SubCategory-->
33+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
34+
<waitForPageLoad stepKey="waitForPageToLoaded"/>
35+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
36+
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/>
37+
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>
38+
39+
<!--Select Content and fill the options-->
40+
<scrollTo selector="{{AdminCategoryContentSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToContent"/>
41+
<click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent"/>
42+
<scrollTo selector="{{AdminCategoryContentSection.AddCMSBlock}}" x="0" y="-80" stepKey="scrollToAddCMSBlock"/>
43+
<selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" userInput="$$createDefaultCMSBlock.title$$" stepKey="selectCMSBlock"/>
44+
45+
<!--Select Display Setting and fill the options-->
46+
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/>
47+
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
48+
<selectOption selector="{{CategoryDisplaySettingsSection.displayMode}}" userInput="PRODUCTS_AND_PAGE" stepKey="selectdisplayMode"/>
49+
<click selector="{{CategoryDisplaySettingsSection.anchorLabel}}" stepKey="uncheckAnchor"/>
50+
<click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/>
51+
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Position', 'Product Name', 'Price']" stepKey="selectPrice"/>
52+
<scrollTo selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" x="0" y="-80" stepKey="scrollToDefaultProductList"/>
53+
<click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/>
54+
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/>
55+
<scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" x="0" y="-80" stepKey="scrollToLayeredNavPrice"/>
56+
<click selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" stepKey="enableLayeredNavigationPrice"/>
57+
<fillField selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" userInput="5.5" stepKey="fillThePrice"/>
58+
59+
<!--Search the products and select the category products-->
60+
<actionGroup ref="AdminAddProductToCategoryActionGroup" stepKey="addProductToCategory">
61+
<argument name="product" value="$$simpleProduct$$"/>
62+
</actionGroup>
63+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton"/>
64+
<waitForPageLoad stepKey="waitForCategorySaved"/>
65+
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the category." stepKey="assertSuccessMessage"/>
66+
<waitForPageLoad stepKey="waitForPageTitleToBeSaved"/>
67+
68+
<!-- Get Category ID -->
69+
<actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId">
70+
<argument name="category" value="{{_defaultCategory.name}}"/>
71+
</actionGroup>
72+
<grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/>
73+
74+
<!--Verify the Category Title-->
75+
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />
76+
77+
<!--Verify Url Rewrite-->
78+
<actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath">
79+
<argument name="redirectPath" value="{{_defaultCategory.name_lwr}}.html"/>
80+
<argument name="redirectType" value="No"/>
81+
<argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/>
82+
</actionGroup>
83+
84+
<!--Verify Product in store front page-->
85+
<amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/>
86+
<waitForPageLoad stepKey="waitForPageToBeLoaded"/>
87+
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/>
88+
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/>
89+
<waitForPageLoad stepKey="waitForProductToLoad"/>
90+
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/>
91+
<dontSeeElement selector="{{StorefrontCategorySidebarSection.filterOptions}}" stepKey="dontSeeFilterOptionsForNonAnchorCategory"/>
92+
</test>
93+
</tests>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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="AdminCreateSimpleProductNotVisibleIndividuallyTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create a Simple Product via Admin"/>
15+
<title value="Create Simple Product that Not Visible Individually"/>
16+
<description value="Create Simple Product that Not Visible Individually"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value=""/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
23+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
24+
</before>
25+
<after>
26+
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
27+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
28+
</after>
29+
30+
<!--Create Simple Product Not Visible Individually-->
31+
<actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin">
32+
<argument name="category" value="$$createPreReqCategory$$"/>
33+
<argument name="simpleProduct" value="simpleProductNotVisibleIndividually"/>
34+
</actionGroup>
35+
36+
<!--Search and verify AssertUrlRewriteNotInGrid-->
37+
<actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchUrlRewriteForNotVisibleProductInGrid">
38+
<argument name="requestPath" value="{{simpleProductNotVisibleIndividually.urlKey}}.html"/>
39+
</actionGroup>
40+
41+
<!--Verify AssertPageByUrlRewriteIsNotFound-->
42+
<actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="amOnPage">
43+
<argument name="requestPath" value="{{simpleProductNotVisibleIndividually.urlKey}}.html"/>
44+
</actionGroup>
45+
</test>
46+
</tests>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@
8383
<!--Verify in Category is not in Url Rewrite grid-->
8484
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteIndexPage"/>
8585
<waitForPageLoad stepKey="waitForUrlRewritePageTopLoad"/>
86-
<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillRequestPath"/>
87-
<click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/>
88-
<see selector="{{AdminUrlRewriteIndexSection.emptyRecordMessage}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/>
86+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
87+
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillRequestPath"/>
88+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
89+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
90+
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/>
8991
</test>
9092
</tests>

0 commit comments

Comments
 (0)