Skip to content

Commit 2d1606d

Browse files
authored
ENGCOM-6765: Cover Search Term Entity Redirect Works on Store Front by MFTF Test #26574
2 parents 12d7e48 + eea749c commit 2d1606d

File tree

5 files changed

+128
-0
lines changed

5 files changed

+128
-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="AdminCreateNewSearchTermEntityActionGroup">
12+
<arguments>
13+
<argument name="query" type="string"/>
14+
<argument name="store" type="string"/>
15+
<argument name="redirectUrl" type="string"/>
16+
</arguments>
17+
18+
<click selector="{{AdminSearchTermsGridSection.addNewEntity}}" stepKey="clickAddNewButton"/>
19+
<fillField stepKey="fillSearchQueryField" selector="{{AdminSearchTermFormSection.searchQuery}}" userInput="{{query}}"/>
20+
<selectOption stepKey="storeSelect" selector="{{AdminSearchTermFormSection.storeID}}" userInput="{{store}}"/>
21+
<fillField stepKey="fillRedirectUrl" selector="{{AdminSearchTermFormSection.redirectUrl}}" userInput="{{redirectUrl}}"/>
22+
<click stepKey="saveSearchTerm" selector="{{AdminSearchTermFormSection.save}}"/>
23+
<waitForPageLoad stepKey="waitForPageLoad"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StoreFrontQuickSearchActionGroup">
12+
<arguments>
13+
<argument name="query" type="string"/>
14+
</arguments>
15+
16+
<fillField stepKey="fillSearchField" selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="{{query}}"/>
17+
<waitForElementVisible selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="waitForSubmitButton"/>
18+
<click stepKey="clickSearchButton" selector="{{StorefrontQuickSearchSection.searchButton}}"/>
19+
</actionGroup>
20+
</actionGroups>
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="AdminSearchTermFormSection">
12+
<element name="save" type="button" selector=".page-actions-buttons .save"/>
13+
<element name="searchQuery" type="input" selector=".admin__field-control.control #query_text"/>
14+
<element name="storeID" type="input" selector=".admin__field-control.control #store_id"/>
15+
<element name="redirectUrl" type="input" selector=".admin__field-control.control #redirect"/>
16+
<element name="displayInTerms" type="input" selector=".admin__field-control.control #display_in_terms"/>
17+
</section>
18+
</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="AdminSearchTermsGridSection">
12+
<element name="addNewEntity" type="button" selector=".page-actions-buttons .add"/>
13+
</section>
14+
</sections>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="StorefrontVerifySearchTermEntityRedirectTest">
12+
<annotations>
13+
<stories value="Search Term Redirect"/>
14+
<title value="Create Search Term Entity With Redirect. Check How Redirect is Working on Storefront"/>
15+
<description value="Storefront search by created search term with redirect. Verifying if created redirect is working"/>
16+
</annotations>
17+
18+
<before>
19+
<!-- Login As Admin User -->
20+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
21+
<!-- Navigate To Marketing Search Terms Grid -->
22+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchTermPage">
23+
<argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/>
24+
<argument name="submenuUiId" value="{{AdminMenuMarketingSEOAndSearchSearchTerms.dataUiId}}"/>
25+
</actionGroup>
26+
<!-- Create Custom Search Term With Redirect -->
27+
<actionGroup ref="AdminCreateNewSearchTermEntityActionGroup" stepKey="createSearchTerm">
28+
<argument name="query" value="{{SearchTerm.query_text}}"/>
29+
<argument name="store" value="{{SearchTerm.store_id}}"/>
30+
<argument name="redirectUrl" value="{{SearchTerm.redirect}}"/>
31+
</actionGroup>
32+
</before>
33+
<after>
34+
<amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="navigateToSearchTermPage"/>
35+
<actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="findCreatedTerm">
36+
<argument name="searchQuery" value="{{SearchTerm.query_text}}"/>
37+
</actionGroup>
38+
<actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteCreatedSearchTerm"/>
39+
</after>
40+
41+
<!-- TEST BODY -->
42+
<!-- Navigate To StoreFront -->
43+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
44+
<!-- Fill in Search Field, Submit Search Request -->
45+
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm">
46+
<argument name="query" value="{{SearchTerm.query_text}}"/>
47+
</actionGroup>
48+
<!-- Assert Current Url -->
49+
<seeCurrentUrlEquals stepKey="checkUrl" url="{{SearchTerm.redirect}}"/>
50+
</test>
51+
</tests>

0 commit comments

Comments
 (0)