|
| 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="AdminProductCreateUrlRewriteForCustomStoreViewTest"> |
| 11 | + <annotations> |
| 12 | + <features value="UrlRewrite"/> |
| 13 | + <stories value="Create Product"/> |
| 14 | + <title value="Product custom URL Key is preserved when assigned to a Category"/> |
| 15 | + <description value="Verify Product custom URL Key (for custom Store View) is preserved when assigned to a Category (with custom URL Key) alongside with another Product without custom URL Key"/> |
| 16 | + <testCaseId value="MC-6463"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory" /> |
| 24 | + </createData> |
| 25 | + <createData entity="SimpleProduct" stepKey="createProductForUrlRewrite"> |
| 26 | + <requiredEntity createDataKey="createCategory" /> |
| 27 | + </createData> |
| 28 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 29 | + <!-- Create second store view--> |
| 30 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 31 | + <argument name="customStore" value="customStore"/> |
| 32 | + </actionGroup> |
| 33 | + </before> |
| 34 | + <after> |
| 35 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct" /> |
| 36 | + <deleteData createDataKey="createProductForUrlRewrite" stepKey="deleteProductForUrlRewrite" /> |
| 37 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory" /> |
| 38 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> |
| 39 | + <argument name="customStore" value="customStore"/> |
| 40 | + </actionGroup> |
| 41 | + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearFilterForStores"/> |
| 42 | + <actionGroup ref="logout" stepKey="logout"/> |
| 43 | + </after> |
| 44 | + <!--Step 1. Navigate as Admin on Product Page for edit product`s Url Key--> |
| 45 | + <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToProductForUrlRewrite"> |
| 46 | + <argument name="product" value="$$createProductForUrlRewrite$$"/> |
| 47 | + </actionGroup> |
| 48 | + <!--Step 2. As Admin switch on Custom Store View from Precondition --> |
| 49 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToCustomStore"> |
| 50 | + <argument name="storeView" value="customStore.name"/> |
| 51 | + </actionGroup> |
| 52 | + <!--Step 3. Set custom URL Key for product on Custom StoreView--> |
| 53 | + <actionGroup ref="AdminProductFormUpdateUrlKeyActionGroup" stepKey="updateUrlKeyForProduct"> |
| 54 | + <argument name="newUrlKey" value="U2"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="saveProductForm" stepKey="saveProductWithNewUrl"/> |
| 57 | + <!--Step 4. Set URL Key for created category --> |
| 58 | + <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedSubCategory"> |
| 59 | + <argument name="Category" value="$$createCategory$$"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="ChangeSeoUrlKey" stepKey="updateUrlKeyForCategory"> |
| 62 | + <argument name="value" value="U1"/> |
| 63 | + </actionGroup> |
| 64 | + <!--Step 5. On Storefront Assert what URL Key for Category is changed and is correct as for Default Store View --> |
| 65 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="onCategoryPage"> |
| 66 | + <argument name="category" value="$$createCategory$$"/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnDefaultStore"> |
| 69 | + <argument name="category" value="$$createCategory.name$$"/> |
| 70 | + <argument name="newRequestPath" value="u1.html"/> |
| 71 | + </actionGroup> |
| 72 | + <!--Step 6. On Storefront Assert what URL Key for product is correct(as initial URL) --> |
| 73 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnStorefrontProduct"> |
| 74 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 75 | + </actionGroup> |
| 76 | + <actionGroup ref="StorefrontCheckProductUrlActionGroup" stepKey="checkProductUrl"> |
| 77 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 78 | + </actionGroup> |
| 79 | + <!--Step 7. On Storefront Assert what URL Key for product is correct for Default Store View (as initial URL) --> |
| 80 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnStorefrontProductWithChangedUrl"> |
| 81 | + <argument name="productUrl" value="$$createProductForUrlRewrite.custom_attributes[url_key]$$"/> |
| 82 | + </actionGroup> |
| 83 | + <actionGroup ref="StorefrontCheckProductUrlActionGroup" stepKey="checkProductWithChangedUrl"> |
| 84 | + <argument name="productUrl" value="$$createProductForUrlRewrite.custom_attributes[url_key]$$"/> |
| 85 | + </actionGroup> |
| 86 | + <!--Step 8. On Storefront switch on created Custom Store View --> |
| 87 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreViewOnStorefront"> |
| 88 | + <argument name="storeView" value="customStore"/> |
| 89 | + </actionGroup> |
| 90 | + <!--Step 9. On Storefront Assert what URL Key for Category is changed and is correct for Custom Store View --> |
| 91 | + <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnCustomStore"> |
| 92 | + <argument name="category" value="$$createCategory.name$$"/> |
| 93 | + <argument name="newRequestPath" value="u1.html"/> |
| 94 | + </actionGroup> |
| 95 | + <!--Step 10. On Storefront Assert what URL Key for product is correct for Custom Store View (as initial URL) --> |
| 96 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="amOnCustomStoreProduct"> |
| 97 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="StorefrontCheckProductUrlActionGroup" stepKey="checkProductP1UrlonCustomStore"> |
| 100 | + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 101 | + </actionGroup> |
| 102 | + <!--Step 11. On Storefront Assert what URL Key for product is changed and is correct for Custom Store View --> |
| 103 | + <actionGroup ref="AssertStorefrontProductRedirect" stepKey="assertProductUrlRewriteInStoreFront"> |
| 104 | + <argument name="productName" value="$$createProductForUrlRewrite.name$$"/> |
| 105 | + <argument name="productSku" value="$$createProductForUrlRewrite.sku$$"/> |
| 106 | + <argument name="productRequestPath" value="u2.html"/> |
| 107 | + </actionGroup> |
| 108 | + </test> |
| 109 | +</tests> |
0 commit comments