<?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="SetCalculationClassForShippingActionGroup">
        <annotations>
            <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Calculation Method Based On' to 'Unit Price'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
        </annotations>
         <arguments>
            <argument name="taxCalculationMethod" type="string" defaultValue="Unit Price"/>
        </arguments>
        <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="openTaxCalculationSettingsSection"/>
        <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" x="0" y="-80" stepKey="goToCheckbox"/>
        <waitForElementVisible selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="seeShippingTaxClass"/>
        <uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithmInherit}}" stepKey="uncheckUseSystemValue"/>
        <selectOption selector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
        <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
        <waitForPageLoad stepKey="waitForConfigSaved"/>
        <click selector="{{AdminConfigureTaxSection.taxCalculationSettingsOpened}}" stepKey="closeTaxCalcSettingsSection"/>
        <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccess"/>
    </actionGroup>
</actionGroups>
