Skip to content

Commit 81072a4

Browse files
author
Serhii Balko
committed
Merge remote-tracking branch 'origin/MC-40376' into 2.4-develop-pr50
2 parents 5a2af59 + 3e3a639 commit 81072a4

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="StoreFrontAssertDropDownSearchSuggestionActionGroup">
12+
<annotations>
13+
<description>Fills the Storefront Quick Search field. Validates that the Search Suggestion is present</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="searchQuery" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" stepKey="waitForQuickSearchToBeVisible"/>
20+
<fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchInput"/>
21+
<waitForElementVisible selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="WaitForSearchDropDownSuggestion"/>
22+
<click selector="//div[@class='panel wrapper']" stepKey="clickOnSomewhere"/>
23+
<dontSee selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="dontSeeDropDownSuggestion"/>
24+
<click selector="{{StorefrontQuickSearchSection.searchPhrase}}" stepKey="clickOnSearchPhrase"/>
25+
<pressKey selector="{{StorefrontQuickSearchSection.searchPhrase}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::DOWN]" stepKey="pressDown"/>
26+
<waitForElementVisible selector="{{StorefrontQuickSearchSection.searchDropDownSuggestion}}" stepKey="WaitForSearchDropDownSuggestionSecond"/>
27+
</actionGroup>
28+
</actionGroups>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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="StorefrontVerifySearchSuggestionByControlButtonsTest">
12+
<annotations>
13+
<stories value="Search Term"/>
14+
<title value="Auto suggestion box not reappearing after clicking outside the text field"/>
15+
<description value="Auto suggestion box not reappearing after clicking outside the text field"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-40466"/>
18+
<useCaseId value="MC-40376"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Create Simple Product -->
23+
<createData entity="defaultSimpleProduct" stepKey="simpleProduct"/>
24+
25+
<!-- Login as admin -->
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
28+
<!-- Perform reindex and flush cache -->
29+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
30+
<argument name="indices" value=""/>
31+
</actionGroup>
32+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
33+
<argument name="tags" value=""/>
34+
</actionGroup>
35+
</before>
36+
<after>
37+
<!-- Delete create product -->
38+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
39+
40+
<!-- Go to the catalog search term page -->
41+
<actionGroup ref="AdminOpenCatalogSearchTermIndexPageActionGroup" stepKey="openAdminCatalogSearchTermIndexPage"/>
42+
43+
<!-- Filter the search term -->
44+
<actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery">
45+
<argument name="searchQuery" value="$simpleProduct.name$"/>
46+
</actionGroup>
47+
<!-- Delete created below search terms -->
48+
<actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/>
49+
</after>
50+
51+
<!-- Go to storefront home page -->
52+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
53+
54+
<!-- Storefront quick search by product name -->
55+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName">
56+
<argument name="phrase" value="$simpleProduct.name$"/>
57+
</actionGroup>
58+
59+
<!-- Verify search suggestions and select the suggestion from dropdown options -->
60+
<actionGroup ref="StoreFrontAssertDropDownSearchSuggestionActionGroup" stepKey="seeDropDownSearchSuggestion">
61+
<argument name="searchQuery" value="$simpleProduct.name$"/>
62+
</actionGroup>
63+
</test>
64+
</tests>

app/code/Magento/Search/view/frontend/web/js/form-mini.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ define([
253253
}
254254
this.element.val(this.responseList.selected.find('.qs-option-name').text());
255255
this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));
256+
this._updateAriaHasPopup(true);
257+
this.autoComplete.show();
256258
}
257259
break;
258260

@@ -269,6 +271,8 @@ define([
269271
}
270272
this.element.val(this.responseList.selected.find('.qs-option-name').text());
271273
this.element.attr('aria-activedescendant', this.responseList.selected.attr('id'));
274+
this._updateAriaHasPopup(true);
275+
this.autoComplete.show();
272276
}
273277
break;
274278
default:

0 commit comments

Comments
 (0)