<?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="SwitchCategoryToAllStoreViewActionGroup">
        <annotations>
            <description>Navigates to category page, selects a category and changes store view to all stores.</description>
        </annotations>
        <arguments>
            <argument name="CatName"/>
        </arguments>

        <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/>
        <waitForPageLoad stepKey="waitForPageLoad1"/>
        <waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/>
        <scrollToTopOfPage stepKey="scrollToToggle"/>
        <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/>
        <click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/>
        <see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/>
        <waitForPageLoad stepKey="waitForPageLoad2"/>
        <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/>
        <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/>
        <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
    </actionGroup>
</actionGroups>
