diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup.xml new file mode 100644 index 0000000000000..4f0b87937baa9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization with uncheck Redirect Checkbox . + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml index 6ffb4e1902424..e766a233c401c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml @@ -110,6 +110,22 @@ false false + + SimpleCategory + simplecategory + true + default-simplecategory + custom-simplecategory + + + SimpleSubCategory + simplesubcategory + true + default-simplesubcategory + custom-simplesubcategory + true + + Gear diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/ActionGroup/StorefrontAssertProductRewriteUrlSubCategoryActionGroup.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/ActionGroup/StorefrontAssertProductRewriteUrlSubCategoryActionGroup.xml new file mode 100644 index 0000000000000..8c0519d08545c --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/ActionGroup/StorefrontAssertProductRewriteUrlSubCategoryActionGroup.xml @@ -0,0 +1,22 @@ + + + + + + Validates that the provided Product Title is present on the Rewrite URL with a subcategory page. + + + + + + + + + + + diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/GenerateCategoryProductUrlRewriteConfigData.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/GenerateCategoryProductUrlRewriteConfigData.xml index 10d2213b64717..9ce6d397a551b 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/GenerateCategoryProductUrlRewriteConfigData.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Data/GenerateCategoryProductUrlRewriteConfigData.xml @@ -19,4 +19,12 @@ No 0 + + catalog/seo/product_use_categories + 1 + + + catalog/seo/product_use_categories + 0 + diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml new file mode 100644 index 0000000000000..2f421276b1889 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml @@ -0,0 +1,80 @@ + + + + + + + <description value="Rewriting URL of product. Verify the full URL address"/> + <group value="CatalogUrlRewrite"/> + </annotations> + + <before> + <magentoCLI command="config:set {{EnableCategoriesPathProductUrls.path}} {{EnableCategoriesPathProductUrls.value}}" stepKey="enableUseCategoriesPath"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> + <createData entity="_defaultCategoryDifferentUrlStore" stepKey="defaultCategory"/> + <createData entity="SimpleSubCategoryDifferentUrlStore" stepKey="subCategory"> + <requiredEntity createDataKey="defaultCategory"/> + </createData> + <createData entity="SimpleProduct" stepKey="simpleProduct"> + <requiredEntity createDataKey="subCategory"/> + </createData> + </before> + + <after> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> + <actionGroup ref="logout" stepKey="logout"/> + <deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/> + <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> + + <magentoCLI command="config:set {{DisableCategoriesPathProductUrls.path}} {{DisableCategoriesPathProductUrls.value}}" stepKey="disableUseCategoriesPath"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </after> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedDefaultCategory"> + <argument name="Category" value="$$defaultCategory$$"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchDefaultStoreViewForDefaultCategory"> + <argument name="storeView" value="_defaultStore.name"/> + </actionGroup> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeSeoUrlKeyForDefaultCategoryDefaultStore"> + <argument name="value" value="{{_defaultCategoryDifferentUrlStore.url_key_default_store}}"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchCustomStoreViewForDefaultCategory"> + <argument name="storeView" value="customStore.name"/> + </actionGroup> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeSeoUrlKeyForDefaultCategoryCustomStore"> + <argument name="value" value="{{_defaultCategoryDifferentUrlStore.url_key_custom_store}}"/> + </actionGroup> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> + <argument name="Category" value="$$subCategory$$"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchDefaultStoreViewForSubCategory"> + <argument name="storeView" value="_defaultStore.name"/> + </actionGroup> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeSeoUrlKeyForSubCategoryDefaultStore"> + <argument name="value" value="{{SimpleSubCategoryDifferentUrlStore.url_key_default_store}}"/> + </actionGroup> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchCustomStoreViewForSubCategory"> + <argument name="storeView" value="customStore.name"/> + </actionGroup> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryWithoutRedirectActionGroup" stepKey="changeSeoUrlKeyForSubCategoryCustomStore"> + <argument name="value" value="{{SimpleSubCategoryDifferentUrlStore.url_key_custom_store}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductRewriteUrlSubCategoryActionGroup" stepKey="validatesRewriteUrl"> + <argument name="category" value="_defaultCategoryDifferentUrlStore"/> + <argument name="subCategory" value="SimpleSubCategoryDifferentUrlStore" /> + <argument name="product" value="SimpleProduct" /> + </actionGroup> + + </test> +</tests>