Skip to content

Commit c484502

Browse files
committed
Merge remote-tracking branch 'remotes/github/MC-18820' into MC-18824_MC-15759_MC-18820
2 parents 364d17e + 7ea9119 commit c484502

File tree

9 files changed

+146
-2
lines changed

9 files changed

+146
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="GeneralLocalCodeConfigsForChina">
12+
<data key="path">general/locale/code</data>
13+
<data key="scope">websites</data>
14+
<data key="scope_code">base</data>
15+
<data key="value">zh_Hans_CN</data>
16+
</entity>
17+
<entity name="GeneralLocalCodeConfigsForUS">
18+
<data key="path">general/locale/code</data>
19+
<data key="scope">websites</data>
20+
<data key="scope_code">base</data>
21+
<data key="value">en_US</data>
22+
</entity>
23+
</entities>

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="localeEnabled" type="select" selector="#general_locale_code:enabled"/>
1616
<element name="localeDisabled" type="select" selector="#general_locale_code[disabled=disabled]"/>
1717
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
18+
<element name="defaultLocale" type="checkbox" selector="#general_locale_code_inherit"/>
1819
</section>
1920
</sections>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@
2323
<entity name="SetMinQueryLengthToOne" type="number">
2424
<data key="value">1</data>
2525
</entity>
26-
</entities>
26+
<entity name="SetCatalogSearchEngineToDefault" type="catalog_search_engine_default">
27+
<requiredEntity type="enable">DefaultCatalogSearchEngine</requiredEntity>
28+
</entity>
29+
<entity name="DefaultCatalogSearchEngine" type="enable">
30+
<data key="inherit">true</data>
31+
</entity>
32+
</entities>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,15 @@
2929
</object>
3030
</object>
3131
</operation>
32+
<operation name="CatalogSearchEngineDefault" dataType="catalog_search_engine_default" type="create" auth="adminFormKey" url="/admin/system_config/save/section/catalog/" method="POST">
33+
<object key="groups" dataType="catalog_search_engine_default">
34+
<object key="search" dataType="catalog_search_engine_default">
35+
<object key="fields" dataType="catalog_search_engine_default">
36+
<object key="engine" dataType="enable">
37+
<field key="inherit">boolean</field>
38+
</object>
39+
</object>
40+
</object>
41+
</object>
42+
</operation>
3243
</operations>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminElasticConnectionTestActionGroup">
12+
<annotations>
13+
<description>Check ElasticSearch connection after enabling.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="openAdminCatalogSearchConfigPage"/>
16+
<waitForPageLoad stepKey="waitPageToLoad"/>
17+
<conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" visible="false" stepKey="expandCatalogSearchTab"/>
18+
<waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="waitForConnectionButton"/>
19+
<click selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="clickOnTestConnectionButton"/>
20+
<waitForPageLoad stepKey="waitForConnectionEstablishment"/>
21+
<grabTextFrom selector="{{AdminCatalogSearchConfigurationSection.connectionStatus}}" stepKey="grabConnectionStatus"/>
22+
<assertEquals expected="{{AdminElasticsearch6TestConnectionMessageData.successMessage}}" expectedType="string" actual="$grabConnectionStatus" stepKey="assertThatConnectionSuccessful"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminElasticsearch6TestConnectionMessageData">
12+
<data key="successMessage">Successful! Test again?</data>
13+
</entity>
14+
</entities>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCatalogSearchConfigurationSection">
12+
<element name="elastic6ConnectionWizard" type="button" selector="#catalog_search_elasticsearch6_test_connect_wizard"/>
13+
<element name="connectionStatus" type="text" selector="#catalog_search_elasticsearch6_test_connect_wizard_result"/>
14+
</section>
15+
</sections>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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="StorefrontElasticSearch6ForChineseLocaleTest">
12+
<annotations>
13+
<features value="Elasticsearch6"/>
14+
<stories value="Elasticsearch6 for Chinese"/>
15+
<title value="Elastic search for Chinese locale"/>
16+
<description value="Elastic search for Chinese locale"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-6310"/>
19+
<useCaseId value="MAGETWO-91625"/>
20+
<group value="elasticsearch"/>
21+
</annotations>
22+
<before>
23+
<!-- Set search engine to Elastic 6, set Locale to China, create category and product, then go to Storefront -->
24+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
25+
<magentoCLI command="config:set --scope={{GeneralLocalCodeConfigsForChina.scope}} --scope-code={{GeneralLocalCodeConfigsForChina.scope_code}} {{GeneralLocalCodeConfigsForChina.path}} {{GeneralLocalCodeConfigsForChina.value}}" stepKey="setLocaleToChina"/>
26+
<magentoCLI command="config:set {{EnableElasticSearch6Config.path}} {{EnableElasticSearch6Config.value}}" stepKey="enableElasticsearch6"/>
27+
<actionGroup ref="AdminElasticConnectionTestActionGroup" stepKey="checkConnection"/>
28+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
29+
<createData entity="ApiCategory" stepKey="createCategory"/>
30+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
34+
</before>
35+
<after>
36+
<!-- Delete created data and reset initial configuration -->
37+
<magentoCLI command="config:set --scope={{GeneralLocalCodeConfigsForUS.scope}} --scope-code={{GeneralLocalCodeConfigsForUS.scope_code}} {{GeneralLocalCodeConfigsForUS.path}} {{GeneralLocalCodeConfigsForUS.value}}" stepKey="setLocaleToUS"/>
38+
<magentoCLI command="config:set {{SetDefaultSearchEngineConfig.path}} {{SetDefaultSearchEngineConfig.value}}" stepKey="resetSearchEnginePreviousState"/>
39+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
40+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
41+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
42+
</after>
43+
<!-- Search for product by name -->
44+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName">
45+
<argument name="phrase" value="$$createProduct.name$$"/>
46+
</actionGroup>
47+
<!-- Check if searched product is displayed -->
48+
<see selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInCategoryPage"/>
49+
</test>
50+
</tests>

app/code/Magento/Search/Test/Mftf/Data/SearchEngineConfigData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
<data key="path">catalog/search/min_query_length</data>
2121
<data key="value">2</data>
2222
</entity>
23-
</entities>
23+
</entities>

0 commit comments

Comments
 (0)