|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test"> |
| 11 | + <annotations> |
| 12 | + <features value="UrlRewrite"/> |
| 13 | + <stories value="Update url rewrites"/> |
| 14 | + <title value="Check url rewrites in catalog categories after changing url key"/> |
| 15 | + <description value="Check url rewrites in catalog categories after changing url key for store view and moving category"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-5352"/> |
| 18 | + <group value="catalog"/> |
| 19 | + <group value="url_rewrite"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create two sub-categories in default category with simple products --> |
| 24 | + <createData entity="_defaultCategory" stepKey="createFirstCategory"/> |
| 25 | + <createData entity="_defaultProduct" stepKey="createFirstSimpleProduct"> |
| 26 | + <requiredEntity createDataKey="createFirstCategory"/> |
| 27 | + </createData> |
| 28 | + <createData entity="_defaultCategory" stepKey="createSecondCategory"/> |
| 29 | + <createData entity="_defaultProduct" stepKey="createSecondSimpleProduct"> |
| 30 | + <requiredEntity createDataKey="createSecondCategory"/> |
| 31 | + </createData> |
| 32 | + |
| 33 | + <!-- Log in to backend --> |
| 34 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 35 | + |
| 36 | + <!--Create additional Store View in Main Website Store --> |
| 37 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> |
| 38 | + <magentoCLI command="indexer:reindex" stepKey="reindexAll"/> |
| 39 | + </before> |
| 40 | + |
| 41 | + <after> |
| 42 | + <deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/> |
| 43 | + <deleteData createDataKey="createSecondCategory" stepKey="deleteSecondCategory"/> |
| 44 | + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> |
| 45 | + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> |
| 46 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> |
| 47 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilters"/> |
| 48 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 49 | + </after> |
| 50 | + |
| 51 | + <!-- On the categories editing page change store view to created additional view --> |
| 52 | + <actionGroup ref="switchCategoryStoreView" stepKey="openFirstCategoryAndSwitchToCustomStoreView"> |
| 53 | + <argument name="Store" value="customStore.name"/> |
| 54 | + <argument name="CatName" value="$createFirstCategory.name$"/> |
| 55 | + </actionGroup> |
| 56 | + |
| 57 | + <!-- Change url key for category for first category; save --> |
| 58 | + <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeFirstCategoryUrlKey"> |
| 59 | + <argument name="value" value="{{SimpleRootSubCategory.url_key}}"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <!-- Change store view to "All store views" for first category --> |
| 63 | + <actionGroup ref="switchCategoryToAllStoreView" stepKey="switchToAllStoreViews"> |
| 64 | + <argument name="CatName" value="$createFirstCategory.name$"/> |
| 65 | + </actionGroup> |
| 66 | + |
| 67 | + <!-- Move first category inside second category --> |
| 68 | + <actionGroup ref="MoveCategoryActionGroup" stepKey="moveFirstCategoryInsideSecondCategory"> |
| 69 | + <argument name="childCategory" value="$createFirstCategory.name$"/> |
| 70 | + <argument name="parentCategory" value="$createSecondCategory.name$"/> |
| 71 | + </actionGroup> |
| 72 | + |
| 73 | + <!-- Open first category storefront page --> |
| 74 | + <amOnPage url="$createSecondCategory.custom_attributes[url_key]$/$createFirstCategory.custom_attributes[url_key]$.html" stepKey="openFirstCategoryStorefrontPage"/> |
| 75 | + <waitForPageLoad stepKey="waitForFirstCategoryStorefrontPageLoad"/> |
| 76 | + <see userInput="$createFirstSimpleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeFirstProductInCategory"/> |
| 77 | + |
| 78 | + <!-- Switch to custom store view--> |
| 79 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> |
| 80 | + <argument name="storeView" value="customStore"/> |
| 81 | + </actionGroup> |
| 82 | + |
| 83 | + <!-- Assert category url with custom store view --> |
| 84 | + <seeInCurrentUrl url="{{SimpleRootSubCategory.url_key}}.html" stepKey="seeUpdatedUrlKey"/> |
| 85 | + <see userInput="$createFirstSimpleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeFirstProductInCategoryAgain"/> |
| 86 | + </test> |
| 87 | +</tests> |
0 commit comments