<?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="ConfigureOrderedConfigurableProductActionGroup">
        <annotations>
            <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description>
        </annotations>
        <arguments>
            <argument name="attribute"/>
            <argument name="option"/>
            <argument name="quantity" type="string"/>
        </arguments>

        <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/>
        <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/>
        <wait time="2" stepKey="waitForOptionsToLoad"/>
        <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/>
        <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
        <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
    </actionGroup>
</actionGroups>
