<?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="AdminCreateCreditMemoWithUpdateQtyActionGroup">
        <annotations>
            <description>Admin starts creating credit memo with 'Update Qty'.</description>
        </annotations>
        <arguments>
            <argument name="productQty" type="string" defaultValue="{{minimalProductQty.value}}"/>
        </arguments>
        <waitForElementClickable selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="waitToClickCreditMemo"/>
        <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/>
        <waitForElementVisible selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" stepKey="waitToItemToRefundTextField"/>
        <fillField selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" userInput="{{productQty}}" stepKey="partialRefund"/>
        <waitForElementClickable selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="waitToClickUpdateQuantity"/>
        <click selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="updateQuantityToRefund"/>
        <waitForPageLoad stepKey="waitForQuantityApplied"/>
    </actionGroup>
</actionGroups>