Skip to content

Commit 27cfb66

Browse files
covered mftf test to create new search term
1 parent 86515dd commit 27cfb66

8 files changed

+152
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminSaveNewSearchTermActionGroup">
12+
<annotations>
13+
<description>Navigate to search terms grid and create a new search term from Magento admin.</description>
14+
</annotations>
15+
<!-- Navigate to search terms grid -->
16+
<amOnPage url="{{AdminSearchTermsGridPage.url}}" stepKey="amOnSearchTermsGrid"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
19+
<!-- Click add new search term button -->
20+
<click selector="{{AdminSearchTermsPageGridActionsSection.addNewSearchTerm}}" stepKey="clickAddNewSearchTermButton"/>
21+
<waitForPageLoad stepKey="waitForPageLoad2"/>
22+
23+
<!-- Fill form fields -->
24+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.query_text}}" userInput="{{SearchTerms.searchQuery}}" stepKey="fillFieldSearchQuery"/>
25+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.store_id}}" userInput="{{SearchTerms.store}}" stepKey="selectStoreView"/>
26+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.redirect}}" userInput="{{SearchTerms.redirectUrl}}" stepKey="fillFieldRedirectUrl"/>
27+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.display_in_terms}}" userInput="{{SearchTerms.suggestedTerms}}" stepKey="selectSuggestedTerms" />
28+
29+
<!-- Click save action and verify success message -->
30+
<click selector="{{AdminSearchTermsPageFormActionsSection.saveSearchTerm}}" stepKey="clickSaveSearchButton"/>
31+
<see userInput="You saved the search term." stepKey="assertSaveSearchTermSuccessMessage" />
32+
</actionGroup>
33+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="SearchTerms">
12+
<data key="searchQuery" unique="suffix">books</data>
13+
<data key="store">Default Store View</data>
14+
<data key="redirectUrl">http://sample.com</data>
15+
<data key="suggestedTerms">1</data>
16+
</entity>
17+
</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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSearchTermsFormPage" url="/search/term/new" area="admin" module="Magento_AdvancedSearch">
12+
<section name="AdminSearchTermsPageFormActionsSection"/>
13+
<section name="AdminSearchTermsPageFormFieldsSection"/>
14+
</page>
15+
</pages>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSearchTermsGridPage" url="/search/term/" area="admin" module="Magento_AdvancedSearch">
12+
<section name="AdminSearchTermsPageGridActionsSection"/>
13+
</page>
14+
</pages>
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="AdminSearchTermsPageFormActionsSection">
12+
<element name="saveSearchTerm" type="button" selector="#save" timeout="30"/>
13+
</section>
14+
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminSearchTermsPageFormFieldsSection">
12+
<element name="query_text" type="input" selector="#query_text"/>
13+
<element name="store_id" type="select" selector="#store_id"/>
14+
<element name="redirect" type="input" selector="#redirect"/>
15+
<element name="display_in_terms" type="select" selector="#display_in_terms"/>
16+
</section>
17+
</sections>
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="AdminSearchTermsPageGridActionsSection">
12+
<element name="addNewSearchTerm" type="button" selector="#add" timeout="30"/>
13+
</section>
14+
</sections>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="AdminAddSearchTermTest">
12+
<annotations>
13+
<features value="AdvancedSearch"/>
14+
<stories value="Add a new search term"/>
15+
<title value="Admin should be able to create a new search term"/>
16+
<description value="Admin should be able to create a new search term using search terms grid"/>
17+
<severity value="CRITICAL"/>
18+
<group value="AdvancedSearch"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="logout" stepKey="logout"/>
25+
</after>
26+
<actionGroup ref="AdminSaveNewSearchTermActionGroup" stepKey="createNewSearchTerm"/>
27+
</test>
28+
</tests>

0 commit comments

Comments
 (0)