<?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="MoveCategoryActionGroup">
        <annotations>
            <description>Move a Category on the Backend Category page.</description>
        </annotations>
        <arguments>
            <argument name="childCategory"/>
            <argument name="parentCategory"/>
        </arguments>

        <click stepKey="expandAllCategoriesTree" selector="{{AdminCategorySidebarTreeSection.expandAll}}"/>
        <waitForAjaxLoad stepKey="waitForCategoriesExpand"/>
        <dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree('childCategory')}}" selector2="{{AdminCategorySidebarTreeSection.categoryInTree('parentCategory')}}" stepKey="moveCategory"/>
        <waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForWarningMessageVisible"/>
        <see selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/>
        <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/>
        <waitForPageLoad stepKey="waitForCategoryPageReload"/>
    </actionGroup>
</actionGroups>
