Skip to content

Commit 02e83ca

Browse files
committed
REFACTOR: Extract Action Groups to separate files (according to MFTF best practices)
1 parent c7ca62e commit 02e83ca

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3030
<deleteData createDataKey="categoryFirst" stepKey="deleteCategory"/>
3131
<actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/>
32-
<actionGroup ref="updateIndexerOnSave" stepKey="resetIndexerBackToOriginalState">
32+
<actionGroup ref="UpdateIndexerOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState">
3333
<argument name="indexerName" value="catalogsearch_fulltext"/>
3434
</actionGroup>
3535
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
@@ -39,7 +39,7 @@
3939
<comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/>
4040
<actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/>
4141
<actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/>
42-
<actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule">
42+
<actionGroup ref="UpdateIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule">
4343
<argument name="indexerName" value="catalogsearch_fulltext"/>
4444
</actionGroup>
4545
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
@@ -57,4 +57,4 @@
5757
<comment userInput="End of searching products" stepKey="endOfSearchingProducts"/>
5858
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/>
5959
</test>
60-
</tests>
60+
</tests>

app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml renamed to app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="updateIndexerBySchedule">
11+
<actionGroup name="UpdateIndexerByScheduleActionGroup">
1212
<annotations>
1313
<description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update by Schedule'. Clicks on Submit.</description>
1414
</annotations>
@@ -24,21 +24,4 @@
2424
<!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
2525
<waitForPageLoad stepKey="waitForSave"/>
2626
</actionGroup>
27-
28-
<actionGroup name="updateIndexerOnSave">
29-
<annotations>
30-
<description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description>
31-
</annotations>
32-
<arguments>
33-
<argument name="indexerName" type="string"/>
34-
</arguments>
35-
36-
<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/>
37-
<waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/>
38-
<click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/>
39-
<selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/>
40-
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/>
41-
<!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
42-
<waitForPageLoad stepKey="waitForSave2"/>
43-
</actionGroup>
4427
</actionGroups>
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="UpdateIndexerOnSaveActionGroup">
12+
<annotations>
13+
<description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="indexerName" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/>
20+
<waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/>
21+
<click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/>
22+
<selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/>
23+
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/>
24+
<!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
25+
<waitForPageLoad stepKey="waitForSave2"/>
26+
</actionGroup>
27+
</actionGroups>

0 commit comments

Comments
 (0)