Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-devel…
Browse files Browse the repository at this point in the history
…op expedited

Accepted Community Pull Requests:
 - #23570: Improve: [UrlRewrite] Move grid implementation to ui components (by @Den4ik)
  • Loading branch information
magento-engcom-team authored Feb 24, 2020
2 parents 555a134 + 8bb26c2 commit 9003079
Show file tree
Hide file tree
Showing 61 changed files with 2,077 additions and 341 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAddProductToCategoryActionGroup">
<annotations>
<description>Add Product to Category</description>
</annotations>
<arguments>
<argument name="product"/>
</arguments>

<scrollTo selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" x="0" y="-80" stepKey="scrollToProductInCategory"/>
<click selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" stepKey="clickOnProductInCategory"/>
<fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="{{product.name}}" stepKey="selectProduct"/>
<click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/>
<click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
<fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
<fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
<selectOption userInput="{{simpleProduct.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/>
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
<fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<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"/>
<element name="displayMode" type="button" selector="select[name='display_mode']"/>
<element name="anchor" type="checkbox" selector="input[name='is_anchor']"/>
<element name="anchorLabel" type="text" selector="input[name='is_anchor']+label"/>
<element name="productListCheckBox" type="checkbox" selector="input[name='use_config[available_sort_by]']" />
<element name="productList" type="text" selector="select[name='available_sort_by']"/>
<element name="defaultProductLisCheckBox" type="checkbox" selector="input[name='use_config[default_sort_by]']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductMessagesSection">
<element name="successMessage" type="text" selector=".message-success"/>
<element name="successMessage" type="text" selector=".message.message-success.success"/>
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<waitForPageLoad stepKey="waitForProdAddToCmpList"/>
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg"/>
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/>
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage"/>
<!--See product in the comparison list-->
<comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/>
Expand All @@ -82,7 +82,7 @@
<waitForPageLoad stepKey="waitProdAddingToCmpList"/>
<!--Assert success message-->
<comment userInput="Assert success message" stepKey="assertSuccessMsg2"/>
<grabTextFrom selector="{{AdminProductMessagesSection.successMessage}}" stepKey="grabTextFromSuccessMessage2"/>
<grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/>
<assertEquals expected='You added product $$product.name$$ to the comparison list.' expectedType="string" actual="($grabTextFromSuccessMessage)" stepKey="assertSuccessMessage2"/>
<!--Check that product displays on add to compare widget-->
<comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
<waitForPageLoad stepKey="waitForPageTitleToBeSaved"/>
<!--Verify the Category Title-->
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />
<grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/>
<!-- Assert Redirect path, Target Path and Redirect type in grid -->
<actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath">
<argument name="redirectPath" value="{{_defaultCategory.name}}.html" />
<argument name="redirectType" value="No" />
<argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/>
</actionGroup>

<!--Clear cache and reindex-->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCreateCategoryWithNoAnchorFieldTest">
<annotations>
<stories value="Create categories"/>
<title value="Create no anchor subcategory with all fields"/>
<description value="Login as admin and create no anchor subcategory with all fields"/>
<testCaseId value=""/>
<severity value="CRITICAL"/>
<group value="Catalog"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
<createData entity="_defaultBlock" stepKey="createDefaultCMSBlock"/>
<createData entity="defaultSimpleProduct" stepKey="simpleProduct" />
</before>
<after>
<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
<deleteData createDataKey="createDefaultCMSBlock" stepKey="deleteDefaultCMSBlock"/>
<deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/>
</after>

<!--Create SubCategory-->
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
<waitForPageLoad stepKey="waitForPageToLoaded"/>
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/>
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>

<!--Select Content and fill the options-->
<scrollTo selector="{{AdminCategoryContentSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToContent"/>
<click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent"/>
<scrollTo selector="{{AdminCategoryContentSection.AddCMSBlock}}" x="0" y="-80" stepKey="scrollToAddCMSBlock"/>
<selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" userInput="$$createDefaultCMSBlock.title$$" stepKey="selectCMSBlock"/>

<!--Select Display Setting and fill the options-->
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/>
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
<selectOption selector="{{CategoryDisplaySettingsSection.displayMode}}" userInput="PRODUCTS_AND_PAGE" stepKey="selectdisplayMode"/>
<click selector="{{CategoryDisplaySettingsSection.anchorLabel}}" stepKey="uncheckAnchor"/>
<click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Position', 'Product Name', 'Price']" stepKey="selectPrice"/>
<scrollTo selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" x="0" y="-80" stepKey="scrollToDefaultProductList"/>
<click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/>
<scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" x="0" y="-80" stepKey="scrollToLayeredNavPrice"/>
<click selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" stepKey="enableLayeredNavigationPrice"/>
<fillField selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" userInput="5.5" stepKey="fillThePrice"/>

<!--Search the products and select the category products-->
<actionGroup ref="AdminAddProductToCategoryActionGroup" stepKey="addProductToCategory">
<argument name="product" value="$$simpleProduct$$"/>
</actionGroup>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton"/>
<waitForPageLoad stepKey="waitForCategorySaved"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the category." stepKey="assertSuccessMessage"/>
<waitForPageLoad stepKey="waitForPageTitleToBeSaved"/>

<!-- Get Category ID -->
<actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId">
<argument name="category" value="{{_defaultCategory.name}}"/>
</actionGroup>
<grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/>

<!--Verify the Category Title-->
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" />

<!--Verify Url Rewrite-->
<actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath">
<argument name="redirectPath" value="{{_defaultCategory.name_lwr}}.html"/>
<argument name="redirectType" value="No"/>
<argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/>
</actionGroup>

<!--Verify Product in store front page-->
<amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/>
<waitForPageLoad stepKey="waitForPageToBeLoaded"/>
<see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/>
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/>
<waitForPageLoad stepKey="waitForProductToLoad"/>
<seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/>
<dontSeeElement selector="{{StorefrontCategorySidebarSection.filterOptions}}" stepKey="dontSeeFilterOptionsForNonAnchorCategory"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCreateSimpleProductNotVisibleIndividuallyTest">
<annotations>
<features value="Catalog"/>
<stories value="Create a Simple Product via Admin"/>
<title value="Create Simple Product that Not Visible Individually"/>
<description value="Create Simple Product that Not Visible Individually"/>
<severity value="CRITICAL"/>
<testCaseId value=""/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
</before>
<after>
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
</after>

<!--Create Simple Product Not Visible Individually-->
<actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin">
<argument name="category" value="$$createPreReqCategory$$"/>
<argument name="simpleProduct" value="simpleProductNotVisibleIndividually"/>
</actionGroup>

<!--Search and verify AssertUrlRewriteNotInGrid-->
<actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchUrlRewriteForNotVisibleProductInGrid">
<argument name="requestPath" value="{{simpleProductNotVisibleIndividually.urlKey}}.html"/>
</actionGroup>

<!--Verify AssertPageByUrlRewriteIsNotFound-->
<actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="amOnPage">
<argument name="requestPath" value="{{simpleProductNotVisibleIndividually.urlKey}}.html"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@
<!--Verify in Category is not in Url Rewrite grid-->
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteIndexPage"/>
<waitForPageLoad stepKey="waitForUrlRewritePageTopLoad"/>
<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillRequestPath"/>
<click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/>
<see selector="{{AdminUrlRewriteIndexSection.emptyRecordMessage}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/>
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillRequestPath"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
<waitForPageLoad stepKey="waitForPageToLoad1"/>
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/>
</test>
</tests>
Loading

0 comments on commit 9003079

Please sign in to comment.