|
| 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" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontProductQuickSearchUsingElasticSearchWithSynonymsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Search"/> |
| 14 | + <stories value="Elasticsearch synonym search"/> |
| 15 | + <title value="Elasticsearch synonym should be restricted to the store scope they are created for"/> |
| 16 | + <description value="Elasticsearch synonym should be restricted to the store scope they are created for"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <useCaseId value="ACP2E-752"/> |
| 19 | + <testCaseId value="AC-3060"/> |
| 20 | + <group value="Catalog"/> |
| 21 | + <group value="SearchEngineElasticsearch" /> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 26 | + <argument name="customStore" value="customStore"/> |
| 27 | + </actionGroup> |
| 28 | + <createData entity="SimpleSubCategory" stepKey="category"/> |
| 29 | + <createData entity="SimpleProduct" stepKey="simpleProduct"> |
| 30 | + <requiredEntity createDataKey="category"/> |
| 31 | + </createData> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> |
| 35 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 36 | + |
| 37 | + <!-- Delete custom store and reset filters on store grid --> |
| 38 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"> |
| 39 | + <argument name="customStore" value="customStore"/> |
| 40 | + </actionGroup> |
| 41 | + <conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .admin__data-grid-filters-current._show" visible="true" stepKey="clearTheFiltersIfPresent"/> |
| 42 | + |
| 43 | + <!-- Delete all search synonyms --> |
| 44 | + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchSynonymsPage"> |
| 45 | + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> |
| 46 | + <argument name="submenuUiId" value="{{AdminSearchSynonyms.dataUiId}}"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminSynonymGridBulkActionGroup" stepKey="deleteAllSynonyms"> |
| 49 | + <argument name="actionLabel" value="Delete"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <!-- Perform the reindex after the synonyms manipulations --> |
| 53 | + <magentoCLI command="indexer:reindex" arguments="catalogsearch_fulltext" stepKey="performReindexAfterSynonyms"/> |
| 54 | + |
| 55 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!-- Go to synonyms page and create new synonyms --> |
| 59 | + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchSynonymsPage"> |
| 60 | + <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> |
| 61 | + <argument name="submenuUiId" value="{{AdminSearchSynonyms.dataUiId}}"/> |
| 62 | + </actionGroup> |
| 63 | + |
| 64 | + <!-- Create 1st synonym --> |
| 65 | + <actionGroup ref="AdminNavigateToNewSearchSynonymsPageActionGroup" stepKey="navigateToNewSearchSynonymsOne"/> |
| 66 | + <actionGroup ref="AdminFillNewSearchSynonymsActionGroup" stepKey="fillFirstSearchSynonym"> |
| 67 | + <argument name="scope_id" value="1:0"/> |
| 68 | + <argument name="synonyms" value="allviews,simple"/> |
| 69 | + </actionGroup> |
| 70 | + <click selector="{{AdminSearchSynonymsNewSection.save}}" stepKey="clickSaveSynonymOneButton"/> |
| 71 | + <waitForPageLoad stepKey="waitPageLoadAfterFirstSynonym"/> |
| 72 | + |
| 73 | + <!-- Create 2nd synonym --> |
| 74 | + <actionGroup ref="AdminNavigateToNewSearchSynonymsPageActionGroup" stepKey="navigateToNewSearchSynonymTwo"/> |
| 75 | + <actionGroup ref="AdminFillNewSearchSynonymsActionGroup" stepKey="fillSecondSearchSynonym"> |
| 76 | + <argument name="scope_id" value="1:1"/> |
| 77 | + <argument name="synonyms" value="defaultview,simple"/> |
| 78 | + </actionGroup> |
| 79 | + <click selector="{{AdminSearchSynonymsNewSection.save}}" stepKey="clickSaveSynonymTwoButton"/> |
| 80 | + <waitForPageLoad stepKey="waitPageLoadAfterSecondSynonym"/> |
| 81 | + |
| 82 | + <!-- Create 3rd synonym --> |
| 83 | + <actionGroup ref="AdminNavigateToNewSearchSynonymsPageActionGroup" stepKey="navigateToNewThirdSearchSynonym"/> |
| 84 | + <actionGroup ref="AdminFillNewSearchSynonymsActionGroup" stepKey="fillThirdSearchSynonym"> |
| 85 | + <argument name="scope_id" value="1:3"/> |
| 86 | + <argument name="synonyms" value="customview,simple"/> |
| 87 | + </actionGroup> |
| 88 | + <click selector="{{AdminSearchSynonymsNewSection.save}}" stepKey="clickSaveSynonymThreeButton"/> |
| 89 | + <waitForPageLoad stepKey="waitPageLoadAfterThirdSynonym"/> |
| 90 | + |
| 91 | + <!-- Perform the reindex after the synonyms manipulations --> |
| 92 | + <magentoCLI command="indexer:reindex" arguments="catalogsearch_fulltext" stepKey="performReindexAfterSynonyms"/> |
| 93 | + |
| 94 | + <!--Navigate to storefront and do a quick searches for the synonyms --> |
| 95 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> |
| 96 | + |
| 97 | + <!-- Verify that all store views synonym is searchable on the default store --> |
| 98 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForAllviewOnDefaultStoreView"> |
| 99 | + <argument name="query" value="allviews"/> |
| 100 | + </actionGroup> |
| 101 | + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeAllviewOnDefaultStoreView"> |
| 102 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 103 | + </actionGroup> |
| 104 | + |
| 105 | + <!-- Verify that default store view synonym is searchable on the default store --> |
| 106 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForDefaultviewOnDefaultStore"> |
| 107 | + <argument name="query" value="defaultview"/> |
| 108 | + </actionGroup> |
| 109 | + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDefaultviewOnDefaultStore"> |
| 110 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 111 | + </actionGroup> |
| 112 | + |
| 113 | + <!-- Verify that custom store view synonym is not searchable on the default store --> |
| 114 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForCustomviewOnDefaultStore"> |
| 115 | + <argument name="query" value="customview"/> |
| 116 | + </actionGroup> |
| 117 | + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeCustomviewOnDefaultStore"> |
| 118 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 119 | + </actionGroup> |
| 120 | + |
| 121 | + <!-- Switch store view to the custom store --> |
| 122 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="selectCustomStoreView"> |
| 123 | + <argument name="storeView" value="customStore"/> |
| 124 | + </actionGroup> |
| 125 | + |
| 126 | + <!-- Verify that all store views synonym is searchable on the custom store --> |
| 127 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForAllviewOnCustomStoreView"> |
| 128 | + <argument name="query" value="allviews"/> |
| 129 | + </actionGroup> |
| 130 | + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeAllviewOnCustomStoreView"> |
| 131 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 132 | + </actionGroup> |
| 133 | + |
| 134 | + <!-- Verify that custom store view synonym is searchable on the custom store --> |
| 135 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForCustomviewOnCustomStore"> |
| 136 | + <argument name="query" value="customview"/> |
| 137 | + </actionGroup> |
| 138 | + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeCustomviewOnCustomStore"> |
| 139 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 140 | + </actionGroup> |
| 141 | + |
| 142 | + <!-- Verify that default store view synonym is not searchable on the custom store --> |
| 143 | + <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchForDefaultviewOnCustomStore"> |
| 144 | + <argument name="query" value="defaultview"/> |
| 145 | + </actionGroup> |
| 146 | + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDefaultviewOnCustom"> |
| 147 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 148 | + </actionGroup> |
| 149 | + </test> |
| 150 | +</tests> |
0 commit comments