|
| 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="StorefrontCategoryUrlRewriteDifferentStoreTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Url rewrites"/> |
| 13 | + <title value="Verify url category for different store view."/> |
| 14 | + <description value="Verify url category for different store view, after change ukr_key category for one of them store view."/> |
| 15 | + <features value="CatalogUrlRewrite"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <magentoCLI command="config:set catalog/seo/product_use_categories 1" stepKey="setEnableUseCategoriesPath"/> |
| 20 | + <createData entity="SubCategory" stepKey="rootCategory"/> |
| 21 | + <createData entity="SimpleSubCategoryDifferentUrlStore" stepKey="subCategory"> |
| 22 | + <requiredEntity createDataKey="rootCategory"/> |
| 23 | + </createData> |
| 24 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 25 | + <requiredEntity createDataKey="subCategory"/> |
| 26 | + </createData> |
| 27 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 28 | + |
| 29 | + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> |
| 30 | + <argument name="storeView" value="customStoreFR"/> |
| 31 | + </actionGroup> |
| 32 | + |
| 33 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> |
| 34 | + <argument name="indices" value=""/> |
| 35 | + </actionGroup> |
| 36 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> |
| 37 | + <argument name="tags" value=""/> |
| 38 | + </actionGroup> |
| 39 | + </before> |
| 40 | + <after> |
| 41 | + <magentoCLI command="config:set catalog/seo/product_use_categories 0" stepKey="setEnableUseCategoriesPath"/> |
| 42 | + <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> |
| 43 | + <deleteData stepKey="deleteSubCategory" createDataKey="subCategory"/> |
| 44 | + <deleteData stepKey="deleteRootCategory" createDataKey="rootCategory"/> |
| 45 | + |
| 46 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> |
| 47 | + <argument name="customStore" value="customStoreFR"/> |
| 48 | + </actionGroup> |
| 49 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 50 | + </after> |
| 51 | + |
| 52 | + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> |
| 53 | + <argument name="Category" value="$$subCategory$$"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchCustomStoreViewForSubCategory"> |
| 56 | + <argument name="storeView" value="customStoreFR.name"/> |
| 57 | + </actionGroup> |
| 58 | + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyForSubCategoryCustomStore"> |
| 59 | + <argument name="value" value="{{SimpleSubCategoryDifferentUrlStore.url_key_custom_store}}"/> |
| 60 | + </actionGroup> |
| 61 | + |
| 62 | + <actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="goToCategoryC"> |
| 63 | + <argument name="categoryName" value="$$rootCategory.name$$"/> |
| 64 | + <argument name="subCategoryName" value="$$subCategory.name$$"/> |
| 65 | + </actionGroup> |
| 66 | + |
| 67 | + <click selector="{{StorefrontCategoryProductSection.ProductInfoByName($$createProduct.name$$)}}" stepKey="navigateToCreateProduct"/> |
| 68 | + |
| 69 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStore"> |
| 70 | + <argument name="storeView" value="customStoreFR" /> |
| 71 | + </actionGroup> |
| 72 | + |
| 73 | + <grabFromCurrentUrl stepKey="grabUrl"/> |
| 74 | + <assertStringContainsString stepKey="assertUrl"> |
| 75 | + <expectedResult type="string">{{SimpleSubCategoryDifferentUrlStore.url_key_custom_store}}</expectedResult> |
| 76 | + <actualResult type="string">{$grabUrl}</actualResult> |
| 77 | + </assertStringContainsString> |
| 78 | + </test> |
| 79 | +</tests> |
0 commit comments