<?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="AdminDeleteMultipleStoresActionGroup">
        <annotations>
            <description>Deletes all specified stores one by one on the 'Stores' page. Defaults to delete all stores
                except the default 'Main Website Store'.</description>
        </annotations>
        <arguments>
            <argument name="storesToDelete" defaultValue="{{AdminStoresMainActionsSection.allNonDefaultStores}}" type="string"/>
            <argument name="expectedRemainingStores" defaultValue="1" type="string"/>
        </arguments>
        <waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilter"/>
        <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="clickResetFilter"/>
        <waitForPageLoad stepKey="waitForGridReset"/>
        <helper class="Magento\Store\Test\Mftf\Helper\StoreHelpers" method="deleteAllSpecifiedStores" stepKey="deleteAllSpecifiedStores">
            <argument name="storesToDelete">{{storesToDelete}}</argument>
            <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument>
            <argument name="createDbBackupButton">{{AdminStoresDeleteStoreGroupSection.createDbBackup}}</argument>
            <argument name="successMessage">You deleted the store.</argument>
            <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument>
        </helper>
        <waitForPageLoad stepKey="waitForGridLoad"/>
        <seeNumberOfElements userInput="{{expectedRemainingStores}}" selector="{{AdminStoresMainActionsSection.allStores}}" stepKey="seeExpectedFinalStores"/>
    </actionGroup>
</actionGroups>
