<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="updateIndexerBySchedule">
        <arguments>
            <argument name="indexerName" type="string"/>
        </arguments>
        <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage"/>
        <waitForPageLoad stepKey="waitForIndexManagementPageToLoad"/>
        <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer1"/>
        <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_changelog" stepKey="selectUpdateBySchedule"/>
        <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm"/>
        <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
        <waitForPageLoad stepKey="waitForSave"/>
    </actionGroup>
    <actionGroup name="updateIndexerOnSave">
        <arguments>
            <argument name="indexerName" type="string"/>
        </arguments>
        <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/>
        <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/>
        <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/>
        <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/>
        <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/>
        <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing -->
        <waitForPageLoad stepKey="waitForSave2"/>

    </actionGroup>
</actionGroups>
