Skip to content

Commit 66e56f7

Browse files
Action groups are seperated as small reusable groups
1 parent 27cfb66 commit 66e56f7

7 files changed

+74
-51
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminFillSearchTermActionGroup">
12+
<annotations>
13+
<description>Fills the search terms form with sample data.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="searchQuery" type="string"/>
17+
<argument name="store" type="string"/>
18+
<argument name="redirectUrl" type="string"/>
19+
<argument name="suggestedTerms" type="string"/>
20+
</arguments>
21+
<!-- Fill form fields -->
22+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.query_text}}" userInput="{{searchQuery}}" stepKey="fillFieldSearchQuery"/>
23+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.store_id}}" userInput="{{store}}" stepKey="selectStoreView"/>
24+
<fillField selector="{{AdminSearchTermsPageFormFieldsSection.redirect}}" userInput="{{redirectUrl}}" stepKey="fillFieldRedirectUrl"/>
25+
<selectOption selector="{{AdminSearchTermsPageFormFieldsSection.display_in_terms}}" userInput="{{suggestedTerms}}" stepKey="selectSuggestedTerms" />
26+
</actionGroup>
27+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenNewSerchTermPageActionGroup">
12+
<annotations>
13+
<description>Navigate to search terms form page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminSearchTermsFormPage.url}}" stepKey="amOnSearchTermsForm"/>
16+
<waitForPageLoad stepKey="waitForPageLoad1"/>
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/AdvancedSearch/Test/Mftf/ActionGroup/AdminSaveNewSearchTermActionGroup.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminSaveSearchTermActionGroup">
12+
<annotations>
13+
<description>Save a new search term from Magento admin.</description>
14+
</annotations>
15+
<!-- Click save action and verify success message -->
16+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/>
17+
<see userInput="You saved the search term." stepKey="assertSaveSearchTermSuccessMessage" />
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/AdvancedSearch/Test/Mftf/Page/AdminSearchTermFormPage.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminSearchTermsFormPage" url="/search/term/new" area="admin" module="Magento_AdvancedSearch">
12-
<section name="AdminSearchTermsPageFormActionsSection"/>
1312
<section name="AdminSearchTermsPageFormFieldsSection"/>
1413
</page>
1514
</pages>

app/code/Magento/AdvancedSearch/Test/Mftf/Section/AdminSearchTermsPageFormActionsSection.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/code/Magento/AdvancedSearch/Test/Mftf/Test/AdminAddSearchTermTest.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
<group value="AdvancedSearch"/>
1919
</annotations>
2020
<before>
21-
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2222
</before>
2323
<after>
24-
<actionGroup ref="logout" stepKey="logout"/>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2525
</after>
26-
<actionGroup ref="AdminSaveNewSearchTermActionGroup" stepKey="createNewSearchTerm"/>
26+
<actionGroup ref="AdminOpenNewSerchTermPageActionGroup" stepKey="navigateToSearchTermPage"/>
27+
<actionGroup ref="AdminFillSearchTermActionGroup" stepKey="fillNewSearchTermData">
28+
<argument name="searchQuery" value="{{SearchTerms.searchQuery}}"/>
29+
<argument name="store" value="{{SearchTerms.store}}"/>
30+
<argument name="redirectUrl" value="{{SearchTerms.redirectUrl}}"/>
31+
<argument name="suggestedTerms" value="{{SearchTerms.suggestedTerms}}"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminSaveSearchTermActionGroup" stepKey="saveSearchTerm"/>
2734
</test>
2835
</tests>

0 commit comments

Comments
 (0)