Skip to content

Commit 75e9bed

Browse files
authored
ENGCOM-7917: #28947 Fix scope reset on new synonym form #29206
2 parents 12cdc54 + e8e2852 commit 75e9bed

File tree

7 files changed

+148
-2
lines changed

7 files changed

+148
-2
lines changed
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="AdminFillNewSearchSynonymsActionGroup">
12+
<annotations>
13+
<description>Fills the search synonyms form field.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="scope_id" type="string"/>
17+
<argument name="synonyms" type="string"/>
18+
</arguments>
19+
20+
<selectOption selector="{{AdminSearchSynonymsNewSection.scope}}" userInput="{{scope_id}}" stepKey="selectScope"/>
21+
<fillField selector="{{AdminSearchSynonymsNewSection.synonyms}}" userInput="{{synonyms}}" stepKey="fillSynonyms"/>
22+
<checkOption selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="checkCheckbox"/>
23+
</actionGroup>
24+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToNewSearchSynonymsPageActionGroup">
12+
<click stepKey="clickNewSynonymsGroupButton" selector="{{AdminSearchSynonymsGridSection.add}}"/>
13+
<waitForPageLoad stepKey="waitForNewSearchSynonymsPageLoaded"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AdminSearchSynonyms" type="SearchSynonyms">
12+
<data key="pageTitle">Search Synonyms</data>
13+
<data key="title">Search Synonyms</data>
14+
<data key="dataUiId">magento-search-search-synonyms</data>
15+
</entity>
16+
</entities>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSearchSynonymsGridSection">
12+
<element name="add" type="button" selector=".page-actions-buttons #add"/>
13+
</section>
14+
</sections>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminSearchSynonymsNewSection">
12+
<element name="save" type="button" selector="//button[@id='save']"/>
13+
<element name="resetButton" type="button" selector="//button[@id='reset']"/>
14+
<element name="scope" type="select" selector="//select[@name='scope_id']"/>
15+
<element name="synonyms" type="textarea" selector="//textarea[@name='synonyms']"/>
16+
<element name="merge" type="checkbox" selector="//input[@name='mergeOnConflict']"/>
17+
</section>
18+
</sections>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="AdminNewSearchSynonymsFormResetTest">
12+
<annotations>
13+
<features value="Search"/>
14+
<stories value="Reset new search synonyms group form"/>
15+
<title value="Admin reset new search synonyms group form"/>
16+
<description value="When admin users reset button on new search synonyms form all fields should be set to default values"/>
17+
<testCaseId value="MC-36382"/>
18+
<severity value="AVERAGE"/>
19+
<group value="Search"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
28+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchSynonymsPage">
29+
<argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/>
30+
<argument name="submenuUiId" value="{{AdminSearchSynonyms.dataUiId}}"/>
31+
</actionGroup>
32+
33+
<actionGroup ref="AdminNavigateToNewSearchSynonymsPageActionGroup" stepKey="navigateToNewSearchSynonymsPage"/>
34+
35+
<actionGroup ref="AdminFillNewSearchSynonymsActionGroup" stepKey="fillNewSearchSynonyms">
36+
<argument name="scope_id" value="1:1"/>
37+
<argument name="synonyms" value="Test Synonyms"/>
38+
</actionGroup>
39+
40+
<click selector="{{AdminSearchSynonymsNewSection.resetButton}}" stepKey="clickResetButton"/>
41+
42+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.scope}}" stepKey="grabScopeValue"/>
43+
<assertEquals stepKey="assertScopeDefaultValue">
44+
<expectedResult type="string">0:0</expectedResult>
45+
<actualResult type="string">$grabScopeValue</actualResult>
46+
</assertEquals>
47+
48+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.synonyms}}" stepKey="grabSynonymsValue"/>
49+
<assertEmpty stepKey="assertSynonymsDefaultValue">
50+
<actualResult type="string">$grabSynonymsValue</actualResult>
51+
</assertEmpty>
52+
53+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="grabMergeValue"/>
54+
<assertEquals stepKey="assertMergeDefaultValue">
55+
<expectedResult type="string">false</expectedResult>
56+
<actualResult type="string">$grabMergeValue</actualResult>
57+
</assertEquals>
58+
</test>
59+
</tests>

app/code/Magento/Search/view/adminhtml/ui_component/search_synonyms_form.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@
6363
<argument name="data" xsi:type="array">
6464
<item name="config" xsi:type="array">
6565
<item name="source" xsi:type="string">block</item>
66-
<item name="default" xsi:type="number">0</item>
66+
<item name="default" xsi:type="string">0:0</item>
6767
</item>
6868
</argument>
6969
<settings>
7070
<validation>
7171
<rule name="required-entry" xsi:type="boolean">true</rule>
7272
</validation>
73-
<dataType>int</dataType>
73+
<dataType>text</dataType>
7474
<tooltip>
7575
<link>https://docs.magento.com/m2/ce/user_guide/stores/websites-stores-views.html</link>
7676
<description translate="true">You can adjust the scope of this synonym group by selecting an option from the list.</description>

0 commit comments

Comments
 (0)