<?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="AdminAddToOrderConfigurableProductActionGroup">
        <arguments>
            <argument name="attribute" type="string"/>
            <argument name="option" type="string"/>
            <argument name="quantity" type="string"/>
        </arguments>
        <scrollTo selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="scroll"/>
        <click selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="focusOnSideDialog"/>
        <waitForAjaxLoad stepKey="waitForAjax"/>
        <click selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" stepKey="clickSelector"/>
        <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" userInput="{{option}}" stepKey="selectionOption"/>
        <waitForAjaxLoad stepKey="waitForAjaxLoad"/>
        <fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
        <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
        <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
        <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
    </actionGroup>
</actionGroups>