Skip to content

Commit 28bc70d

Browse files
committed
MAGETWO-73989: [GitHub] Minimal Query Length For Catalog Search #6681
1 parent ddf76d3 commit 28bc70d

File tree

9 files changed

+34
-24
lines changed

9 files changed

+34
-24
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<element name="categoryPageProductImage" type="text" selector=".products-grid img[src*='/{{var1}}']" parameterized="true"/>
2424
<element name="categoryPageProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
2525
<element name="categoryEmptyMessage" type="text" selector=".column.main .message.info.empty"/>
26-
<element name="productName" type="text" selector=".product-item-name"/>
26+
<element name="productNameInGrid" type="text" selector="//div[contains(@class,'products-grid')]//strong[contains(@class,'product-item-name')]//a[normalize-space(text())='{{var}}']" parameterized="true"/>
2727
</section>
2828
</sections>

app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminAssertQueryLengthHintsActionGroup.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminAssertQueryLengthHintsActionGroup">
12-
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="navigateToConfigurationPage"/>
13-
<scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab"/>
14-
<conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.minQueryLength}}" visible="false" stepKey="expandCatalogSearchTab"/>
15-
<waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.minQueryLength}}" stepKey="waitForMinQueryLengthField"/>
16-
<see userInput="{{MinMaxQueryLength.Hint}}" selector="{{AdminCatalogSearchConfigurationSection.minQueryLengthHint}}" stepKey="seeMinQueryLengthHint"/>
17-
<see userInput="{{MinMaxQueryLength.Hint}}" selector="{{AdminCatalogSearchConfigurationSection.maxQueryLengthHint}}" stepKey="seeMaxQueryLengthHint"/>
12+
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url('#catalog_search-link')}}" stepKey="navigateToConfigurationPage"/>
13+
<see userInput="{{MinMaxQueryLength.hint}}" selector="{{AdminCatalogSearchConfigurationSection.minQueryLengthHint}}" stepKey="seeMinQueryLengthHint"/>
14+
<see userInput="{{MinMaxQueryLength.hint}}" selector="{{AdminCatalogSearchConfigurationSection.maxQueryLengthHint}}" stepKey="seeMaxQueryLengthHint"/>
1815
</actionGroup>
1916
</actionGroups>

app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSearchProductActionGroup.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="StorefrontSearchProductActionGroup">
11+
<actionGroup name="StorefrontSearchProductActionGroup" extends="StorefrontQuickSearchActionGroup">
1212
<arguments>
1313
<argument name="product"/>
14-
<argument name="textForSearch" type="string"/>
1514
</arguments>
16-
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
17-
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="{{textForSearch}}" stepKey="fillSearchField"/>
18-
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
19-
<see selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{product.name}}" stepKey="seeProductNameInCatalogSearchPage"/>
15+
<see selector="{{StorefrontCategoryMainSection.productNameInGrid(product.name)}}" userInput="{{product.name}}" after="clickSearchButton" stepKey="seeProductNameInCatalogSearchPage"/>
2016
</actionGroup>
2117
</actionGroups>

app/code/Magento/CatalogSearch/Test/Mftf/Data/CatalogSearchData.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11-
<entity name="SetMinQueryLengthToDefault" type="catalog_search_config_def">
11+
<entity name="SetMinQueryLengthToDefault" type="catalog_search_config">
1212
<requiredEntity type="length_config">DefaultMinQueryLength</requiredEntity>
1313
</entity>
14-
<entity name="SetMinQueryLength" type="catalog_search_config_def">
14+
<entity name="SetMinQueryLength" type="catalog_search_config">
1515
<requiredEntity type="length_config">SetMinQueryLengthToOne</requiredEntity>
1616
</entity>
17-
<entity name="SetMinQueryLength2" type="catalog_search_config_def">
17+
<entity name="SetMinQueryLength2" type="catalog_search_config">
1818
<requiredEntity type="length_config">SetMinQueryLengthToTwo</requiredEntity>
1919
</entity>
2020

@@ -31,6 +31,6 @@
3131
</entity>
3232

3333
<entity name="MinMaxQueryLength" type="constant">
34-
<data key="Hint">This value must be compatible with the corresponding setting in the configured search engine</data>
34+
<data key="hint">This value must be compatible with the corresponding setting in the configured search engine</data>
3535
</entity>
3636
</entities>

app/code/Magento/CatalogSearch/Test/Mftf/Metadata/catalog_search-meta.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
-->
88
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10-
<operation name="CatalogSearchConfigDefault" dataType="catalog_search_config_def" type="create" auth="adminFormKey" url="/admin/system_config/save/section/catalog/" method="POST" successRegex="/messages-message-success/">
11-
<object key="groups" dataType="catalog_search_config_def">
12-
<object key="search" dataType="catalog_search_config_def">
13-
<object key="fields" dataType="catalog_search_config_def">
10+
<operation name="CatalogSearchConfig" dataType="catalog_search_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/catalog/" method="POST" successRegex="/messages-message-success/">
11+
<object key="groups" dataType="catalog_search_config">
12+
<object key="search" dataType="catalog_search_config">
13+
<object key="fields" dataType="catalog_search_config">
1414
<object key="min_query_length" dataType="length_config">
1515
<field key="inherit">boolean</field>
1616
<field key="value">integer</field>

app/code/Magento/CatalogSearch/Test/Mftf/Section/AdminCatalogSearchConfigurationSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCatalogSearchConfigurationSection">
12-
<element name="catalogSearchTab" type="button" selector="#catalog_search-head" timeout="10"/>
1312
<element name="minQueryLength" type="input" selector="#catalog_search_min_query_length"/>
1413
<element name="minQueryLengthInherit" type="checkbox" selector="#catalog_search_min_query_length_inherit"/>
1514
<element name="minQueryLengthHint" type="text" selector="#row_catalog_search_min_query_length .value span"/>

app/code/Magento/Config/Test/Mftf/Page/AdminCatalogSearchConfigurationPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
9-
<page name="AdminCatalogSearchConfigurationPage" url="admin/system_config/edit/section/catalog/" area="admin" module="Magento_Config">
9+
<page name="AdminCatalogSearchConfigurationPage" url="admin/system_config/edit/section/catalog/{{tab_anchor}}" area="admin" module="Magento_Config" parameterized="true">
1010
<section name="AdminCatalogSearchConfigurationSection"/>
1111
</page>
1212
</pages>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontQuickSearchActionGroup">
12+
<arguments>
13+
<argument name="textForSearch" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
16+
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="{{textForSearch}}" stepKey="fillSearchField"/>
17+
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
18+
</actionGroup>
19+
</actionGroups>

dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
<constraint name="Magento\CatalogSearch\Test\Constraint\AssertProductCanBeOpenedFromSearchResult" />
6161
</variation>
6262
<variation name="SearchEntityResultsTestVariation13" summary="Search for simple product name using 3 symbols query length" ticketId="MAGETWO-36542">
63-
<data name="tag" xsi:type="string">stable:no</data>
6463
<data name="catalogSearch/data/query_text/value" xsi:type="string">catalogProductSimple::default::name</data>
6564
<data name="queryLength" xsi:type="string">3</data>
6665
<constraint name="Magento\CatalogSearch\Test\Constraint\AssertProductCanBeOpenedFromSearchResult" />

0 commit comments

Comments
 (0)