Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFillNewSearchSynonymsActionGroup">
<annotations>
<description>Fills the search synonyms form field.</description>
</annotations>
<arguments>
<argument name="scope_id" type="string"/>
<argument name="synonyms" type="string"/>
</arguments>

<selectOption selector="{{AdminSearchSynonymsNewSection.scope}}" userInput="{{scope_id}}" stepKey="selectScope"/>
<fillField selector="{{AdminSearchSynonymsNewSection.synonyms}}" userInput="{{synonyms}}" stepKey="fillSynonyms"/>
<checkOption selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="checkCheckbox"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminNavigateToNewSearchSynonymsPageActionGroup">
<click stepKey="clickNewSynonymsGroupButton" selector="{{AdminSearchSynonymsGridSection.add}}"/>
<waitForPageLoad stepKey="waitForNewSearchSynonymsPageLoaded"/>
</actionGroup>
</actionGroups>
16 changes: 16 additions & 0 deletions app/code/Magento/Search/Test/Mftf/Data/SearchSynonymsData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="AdminSearchSynonyms" type="SearchSynonyms">
<data key="pageTitle">Search Synonyms</data>
<data key="title">Search Synonyms</data>
<data key="dataUiId">magento-search-search-synonyms</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSearchSynonymsGridSection">
<element name="add" type="button" selector=".page-actions-buttons #add"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSearchSynonymsNewSection">
<element name="save" type="button" selector="//button[@id='save']"/>
<element name="resetButton" type="button" selector="//button[@id='reset']"/>
<element name="scope" type="select" selector="//select[@name='scope_id']"/>
<element name="synonyms" type="textarea" selector="//textarea[@name='synonyms']"/>
<element name="merge" type="checkbox" selector="//input[@name='mergeOnConflict']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminNewSearchSynonymsFormResetTest">
<annotations>
<features value="Search"/>
<stories value="Reset new search synonyms group form"/>
<title value="Admin reset new search synonyms group form"/>
<description value="When admin users reset button on new search synonyms form all fields should be set to default values"/>
<testCaseId value="MC-36382"/>
<severity value="AVERAGE"/>
<group value="Search"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchSynonymsPage">
<argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/>
<argument name="submenuUiId" value="{{AdminSearchSynonyms.dataUiId}}"/>
</actionGroup>

<actionGroup ref="AdminNavigateToNewSearchSynonymsPageActionGroup" stepKey="navigateToNewSearchSynonymsPage"/>

<actionGroup ref="AdminFillNewSearchSynonymsActionGroup" stepKey="fillNewSearchSynonyms">
<argument name="scope_id" value="1:1"/>
<argument name="synonyms" value="Test Synonyms"/>
</actionGroup>

<click selector="{{AdminSearchSynonymsNewSection.resetButton}}" stepKey="clickResetButton"/>

<grabValueFrom selector="{{AdminSearchSynonymsNewSection.scope}}" stepKey="grabScopeValue"/>
<assertEquals stepKey="assertScopeDefaultValue">
<expectedResult type="string">0:0</expectedResult>
<actualResult type="string">$grabScopeValue</actualResult>
</assertEquals>

<grabValueFrom selector="{{AdminSearchSynonymsNewSection.synonyms}}" stepKey="grabSynonymsValue"/>
<assertEmpty stepKey="assertSynonymsDefaultValue">
<actualResult type="string">$grabSynonymsValue</actualResult>
</assertEmpty>

<grabValueFrom selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="grabMergeValue"/>
<assertEquals stepKey="assertMergeDefaultValue">
<expectedResult type="string">false</expectedResult>
<actualResult type="string">$grabMergeValue</actualResult>
</assertEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">block</item>
<item name="default" xsi:type="number">0</item>
<item name="default" xsi:type="string">0:0</item>
</item>
</argument>
<settings>
<validation>
<rule name="required-entry" xsi:type="boolean">true</rule>
</validation>
<dataType>int</dataType>
<dataType>text</dataType>
<tooltip>
<link>https://docs.magento.com/m2/ce/user_guide/stores/websites-stores-views.html</link>
<description translate="true">You can adjust the scope of this synonym group by selecting an option from the list.</description>
Expand Down