<?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="AdminStoreGroupCreateActionGroup">
        <annotations>
            <description>Fills in the provided Website and Store Group details. Clicks on Save. Validates that the Success Message is present and correct.</description>
        </annotations>
        <arguments>
            <argument name="Website" defaultValue="_defaultWebsite"/>
            <argument name="storeGroup"/>
        </arguments>

        <amOnPage url="{{AdminSystemStoreGroupPage.url}}" stepKey="navigateToNewStoreGroup"/>
        <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/>
        <comment userInput="Creating Store Group" stepKey="storeGroupCreationComment"/>
        <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{Website.name}}" stepKey="selectWebsite"/>
        <fillField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroup.name}}" stepKey="enterStoreGroupName"/>
        <fillField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroup.code}}" stepKey="enterStoreGroupCode"/>
        <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category"  stepKey="setRootCategory"/>
        <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/>
        <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/>
        <see userInput="You saved the store." stepKey="seeSavedMessage"/>
    </actionGroup>
</actionGroups>
