Skip to content

Commit 39aff39

Browse files
committed
Covered MFTF for new search synonyms form reset
1 parent 87d1094 commit 39aff39

File tree

6 files changed

+149
-0
lines changed

6 files changed

+149
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<argument name="merge" type="string"/>
19+
</arguments>
20+
21+
<selectOption selector="{{AdminSearchSynonymsNewSection.scope}}" userInput="{{scope_id}}" stepKey="selectScope"/>
22+
<fillField selector="{{AdminSearchSynonymsNewSection.synonyms}}" userInput="{{synonyms}}" stepKey="fillSynonyms"/>
23+
<checkOption selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="checkCheckbox"/>
24+
</actionGroup>
25+
</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: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
<severity value="AVERAGE"/>
18+
<group value="Search"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
27+
<!--TEST BODY -->
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+
<argument name="merge" value="true"/>
39+
</actionGroup>
40+
41+
<click selector="{{AdminSearchSynonymsNewSection.resetButton}}" stepKey="clickResetButton"/>
42+
43+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.scope}}" stepKey="grabScopeValue"/>
44+
<assertEquals stepKey="assertScopeDefaultValue">
45+
<expectedResult type="string">0:0</expectedResult>
46+
<actualResult type="string">$grabScopeValue</actualResult>
47+
</assertEquals>
48+
49+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.synonyms}}" stepKey="grabSynonymsValue"/>
50+
<assertEmpty stepKey="assertSynonymsDefaultValue">
51+
<actualResult type="string">$grabSynonymsValue</actualResult>
52+
</assertEmpty>
53+
54+
<grabValueFrom selector="{{AdminSearchSynonymsNewSection.merge}}" stepKey="grabMergeValue"/>
55+
<assertEquals stepKey="assertMergeDefaultValue">
56+
<expectedResult type="string">false</expectedResult>
57+
<actualResult type="string">$grabMergeValue</actualResult>
58+
</assertEquals>
59+
<!--END TEST BODY -->
60+
</test>
61+
</tests>

0 commit comments

Comments
 (0)