<?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="SetOrderInvoiceSettingsForShippingActionGroup">
        <annotations>
            <description>Goes to the 'Configuration' page for 'Orders, Invoices, Credit Memos Display Settings'. Sets 'Display Subtotal' to 'Include and Excluded tax'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description>
        </annotations>
         <arguments>
            <argument name="taxCalculationMethod" type="string" defaultValue="Including and Excluding Tax"/>
        </arguments>
        <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <click selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" stepKey="openOrdersInvoicesCreditSales"/>
        <waitForElementVisible selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="seeShippingTaxClass"/>
        <uncheckOption selector="{{AdminConfigureTaxSection.orderInvoiceSubtotalInherit}}" stepKey="uncheckUseSystemValue"/>
        <selectOption selector="{{AdminConfigureTaxSection.orderInvoiceDisplaySubtotal}}" userInput="{{taxCalculationMethod}}" stepKey="setShippingTaxClass"/>
        <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/>
        <waitForPageLoad stepKey="waitForConfigSaved"/>
        <click selector="{{AdminConfigureTaxSection.taxSalesDisplayHeadOpen}}" stepKey="taxSalesDisplayHeadClosed"/>
        <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccess"/>
    </actionGroup>
</actionGroups>
