<?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="AddCostPriceToProductActionGroup">
        <annotations>
            <description>Sets the provided Cost Price on the Admin Product creation/edit page.</description>
        </annotations>
        <arguments>
            <argument name="price" type="string" defaultValue="10"/>
        </arguments>

        <waitForPageLoad stepKey="waitForPageLoad"/>
        <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
        <waitForPageLoad stepKey="waitForAdvancedPricingModal"/>
        <waitForElementVisible selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="waitCostPrice"/>
        <fillField userInput="{{price}}" selector="{{AdminProductFormCostPricingSection.costPrice}}" stepKey="fillCostPrice"/>
        <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
        <waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/>
        <dontSeeElement selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickAdvancedPricingCloseButton"/>
    </actionGroup>
</actionGroups>
