Skip to content

Commit c13d438

Browse files
committed
Merge branch 'MC-6310' into 'MC-18820'
MC-18820: Increase test coverage for Admin functional area See merge request magn-m23/magn-m23!1743
2 parents 528812b + 8e985b1 commit c13d438

File tree

6 files changed

+78
-23
lines changed

6 files changed

+78
-23
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/Elasticsearch6/Test/Mftf/ActionGroup/AdminElasticConnectionTestActionGroup.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminElasticConnectionTestActionGroup">
12+
<annotations>
13+
<description>Check ElasticSearch connection after enabling.</description>
14+
</annotations>
1215
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="openAdminCatalogSearchConfigPage"/>
1316
<waitForPageLoad stepKey="waitPageToLoad"/>
1417
<conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" visible="false" stepKey="expandCatalogSearchTab"/>
1518
<waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="waitForConnectionButton"/>
1619
<click selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="clickOnTestConnectionButton"/>
1720
<waitForPageLoad stepKey="waitForConnectionEstablishment"/>
1821
<grabTextFrom selector="{{AdminCatalogSearchConfigurationSection.connectionStatus}}" stepKey="grabConnectionStatus"/>
19-
<assertEquals expected="Successful! Test again?" expectedType="string" actual="$grabConnectionStatus" stepKey="assertThatConnectionSuccessful"/>
20-
<scrollTo selector="{{AdminConfigCatalogCategoryPermissionsSection.catalogPermissionsTab}}" stepKey="scrollToCatalogPermissionsTab"/>
21-
<click selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="closeCatalogSearchTab"/>
22+
<assertEquals expected="{{AdminElasticsearch6TestConnectionMessageData.successMessage}}" expectedType="string" actual="$grabConnectionStatus" stepKey="assertThatConnectionSuccessful"/>
2223
</actionGroup>
2324
</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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="EnableElasticSearch6Config">
12+
<data key="path">catalog/search/engine</data>
13+
<data key="value">elasticsearch6</data>
14+
</entity>
15+
</entities>

app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="StorefrontElasticSearchForChineseLocaleTest">
11+
<test name="StorefrontElasticSearch6ForChineseLocaleTest">
1212
<annotations>
13-
<features value="Elasticsearch"/>
14-
<stories value="Elasticsearch for Chinese produce error"/>
13+
<features value="Elasticsearch6"/>
14+
<stories value="Elasticsearch6 for Chinese"/>
1515
<title value="Elastic search for Chinese locale"/>
1616
<description value="Elastic search for Chinese locale"/>
1717
<severity value="CRITICAL"/>
@@ -21,10 +21,9 @@
2121
</annotations>
2222
<before>
2323
<!-- Set search engine to Elastic 6, set Locale to China, create category and product, then go to Storefront -->
24-
<comment userInput="Set search engine to Elastic 6, set Locale to China, create category and product, then go to Storefront" stepKey="doInitialSetups"/>
2524
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
26-
<magentoCLI command="config:set --scope=websites --scope-code=base general/locale/code zh_Hans_CN" stepKey="setLocaleToChina"/>
27-
<magentoCLI command="config:set catalog/search/engine elasticsearch6" stepKey="setSearchEngineToElastic6"/>
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"/>
2827
<actionGroup ref="AdminElasticConnectionTestActionGroup" stepKey="checkConnection"/>
2928
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3029
<createData entity="ApiCategory" stepKey="createCategory"/>
@@ -35,29 +34,17 @@
3534
</before>
3635
<after>
3736
<!-- Delete created data and reset initial configuration -->
38-
<comment userInput="Delete created data and reset initial configuration" stepKey="deleteCreatedDataAndResetConfig"/>
39-
<amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="goToConfigurationGeneralPage"/>
40-
<waitForPageLoad stepKey="waitForPageLoad"/>
41-
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="adminSwitchWebsiteActionGroup">
42-
<argument name="website" value="_defaultWebsite"/>
43-
</actionGroup>
44-
<conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection"/>
45-
<checkOption selector="{{LocaleOptionsSection.defaultLocale}}" stepKey="setDefaultLocaleValue"/>
46-
<click selector="{{LocaleOptionsSection.sectionHeader}}" stepKey="closeTab"/>
47-
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/>
48-
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccess"/>
49-
<createData entity="SetCatalogSearchEngineToDefault" stepKey="setSearchEngineToDefault"/>
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"/>
5039
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
5140
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
5241
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
5342
</after>
5443
<!-- Search for product by name -->
55-
<comment userInput="Search for product by name" stepKey="searchForProduct"/>
5644
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByProductName">
5745
<argument name="phrase" value="$$createProduct.name$$"/>
5846
</actionGroup>
5947
<!-- Check if searched product is displayed -->
60-
<comment userInput="Check if searched product is displayed" stepKey="checkThatProductIsDisplayed"/>
6148
<see selector="{{StorefrontCategoryMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInCategoryPage"/>
6249
</test>
6350
</tests>
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SetDefaultSearchEngineConfig">
12+
<data key="path">catalog/search/engine</data>
13+
<data key="value">mysql</data>
14+
</entity>
15+
</entities>

0 commit comments

Comments
 (0)