|
| 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="StorefrontQuickSearchSkuWithSpecialCharRankingTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Search"/> |
| 14 | + <stories value="Search Product on Storefront"/> |
| 15 | + <title value="Quick Search should rank product which SKU matches exactly the search term highly in the result"/> |
| 16 | + <description value="Quick Search should rank product which SKU matches exactly the search term highly in the result"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <useCaseId value="ACP2E-8"/> |
| 19 | + <testCaseId value="AC-1259"/> |
| 20 | + <group value="SearchEngineElasticsearch"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Create product1--> |
| 24 | + <createData entity="SimpleTwo" stepKey="product1"> |
| 25 | + <field key="sku">ZXH-QJ185</field> |
| 26 | + </createData> |
| 27 | + <!--Create product2--> |
| 28 | + <createData entity="SimpleTwo" stepKey="product2"> |
| 29 | + <field key="name">ZXH-QJ185</field> |
| 30 | + </createData> |
| 31 | + <!--Login as admin--> |
| 32 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 33 | + <!--Open "SKU" attribute in admin--> |
| 34 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenSkuAttribute"> |
| 35 | + <argument name="productAttributeCode" value="sku"/> |
| 36 | + </actionGroup> |
| 37 | + <!--Set "SKU" attribute search weight--> |
| 38 | + <actionGroup ref="AdminProductAttributeSetSearchWeightActionGroup" stepKey="setSkuSearchWeight"> |
| 39 | + <argument name="value" value="10"/> |
| 40 | + </actionGroup> |
| 41 | + <!--Save "SKU" attribute--> |
| 42 | + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveSkuAttribute"/> |
| 43 | + <!--Open "Name" attribute in admin--> |
| 44 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> |
| 45 | + <argument name="productAttributeCode" value="name"/> |
| 46 | + </actionGroup> |
| 47 | + <!--Set "Name" attribute search weight--> |
| 48 | + <actionGroup ref="AdminProductAttributeSetSearchWeightActionGroup" stepKey="setNameSearchWeight"> |
| 49 | + <argument name="value" value="2"/> |
| 50 | + </actionGroup> |
| 51 | + <!--Save "Name" attribute--> |
| 52 | + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveNameAttribute"/> |
| 53 | + <!--Reindex--> |
| 54 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 55 | + <argument name="indices" value=""/> |
| 56 | + </actionGroup> |
| 57 | + <!--Clean cache--> |
| 58 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache"> |
| 59 | + <argument name="tags" value=""/> |
| 60 | + </actionGroup> |
| 61 | + </before> |
| 62 | + <after> |
| 63 | + <!--Delete product1--> |
| 64 | + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> |
| 65 | + <!--Delete product2--> |
| 66 | + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> |
| 67 | + <!--Open "SKU" attribute in admin--> |
| 68 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenSkuAttribute"> |
| 69 | + <argument name="productAttributeCode" value="sku"/> |
| 70 | + </actionGroup> |
| 71 | + <!--Reset "SKU" attribute search weight--> |
| 72 | + <actionGroup ref="AdminProductAttributeSetSearchWeightActionGroup" stepKey="setSkuSearchWeight"> |
| 73 | + <argument name="value" value="6"/> |
| 74 | + </actionGroup> |
| 75 | + <!--Save "SKU" attribute--> |
| 76 | + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveSkuAttribute"/> |
| 77 | + <!--Open "Name" attribute in admin--> |
| 78 | + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="OpenNameAttribute"> |
| 79 | + <argument name="productAttributeCode" value="name"/> |
| 80 | + </actionGroup> |
| 81 | + <!--Reset "Name" attribute search weight--> |
| 82 | + <actionGroup ref="AdminProductAttributeSetSearchWeightActionGroup" stepKey="setNameSearchWeight"> |
| 83 | + <argument name="value" value="5"/> |
| 84 | + </actionGroup> |
| 85 | + <!--Save "Name" attribute--> |
| 86 | + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveNameAttribute"/> |
| 87 | + <!--Clear grid filter--> |
| 88 | + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> |
| 89 | + <!--Logout from admin--> |
| 90 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 91 | + </after> |
| 92 | + <!--Navigate to home page--> |
| 93 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/> |
| 94 | + <!--Search for word "ZXH-QJ185"--> |
| 95 | + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="search"> |
| 96 | + <argument name="phrase" value="ZXH-QJ185"/> |
| 97 | + </actionGroup> |
| 98 | + <!--Assert that product1 is first in the search result--> |
| 99 | + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct1Position"> |
| 100 | + <argument name="productName" value="$product1.name$"/> |
| 101 | + <argument name="index" value="1"/> |
| 102 | + </actionGroup> |
| 103 | + <!--Assert that product2 is second in the search result--> |
| 104 | + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct2Position"> |
| 105 | + <argument name="productName" value="$product2.name$"/> |
| 106 | + <argument name="index" value="2"/> |
| 107 | + </actionGroup> |
| 108 | + </test> |
| 109 | +</tests> |
| 110 | + |
0 commit comments