<?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="goToInvoiceIntoOrder">
        <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/>
        <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/>
        <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
    </actionGroup>
    <actionGroup name="submitInvoiceIntoOrder">
        <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
        <waitForPageLoad stepKey="waitForInvoiceSubmit"/>
        <seeInCurrentUrl url="sales/order/view/order_id/" stepKey="seeViewOrderPageInvoice"/>
        <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/>
    </actionGroup>

    <actionGroup name="VertexCheckProductPricingInAdminInvoiceView">
        <arguments>
            <argument name="product"/>
            <argument type="string" name="priceExclTax"/>
            <argument type="string" name="priceInclTax"/>
            <argument type="string" name="subtotalExclTax"/>
            <argument type="string" name="subtotalInclTax"/>
            <argument type="string" name="tax"/>
            <argument type="string" name="discount"/>
            <argument type="string" name="rowTotal"/>
        </arguments>

        <see stepKey="seePriceExclTax" userInput="{{priceExclTax}}" selector="{{AdminInvoiceItemsOrderedSection.itemPriceExclTaxByName(product.name)}}"/>
        <see stepKey="seePriceInclTax" userInput="{{priceInclTax}}" selector="{{AdminInvoiceItemsOrderedSection.itemPriceInclTaxByName(product.name)}}"/>
        <see stepKey="seeSubtotalExclTax" userInput="{{subtotalExclTax}}" selector="{{AdminInvoiceItemsOrderedSection.itemSubtotalExclTaxByName(product.name)}}"/>
        <see stepKey="seeSubtotalInclTax" userInput="{{subtotalInclTax}}" selector="{{AdminInvoiceItemsOrderedSection.itemSubtotalInclTaxByName(product.name)}}"/>
        <see stepKey="seeTax" userInput="{{tax}}" selector="{{AdminInvoiceItemsOrderedSection.itemTaxByName(product.name)}}"/>
        <see stepKey="seeDiscount" userInput="{{discount}}" selector="{{AdminInvoiceItemsOrderedSection.itemDiscountByName(product.name)}}"/>
        <see stepKey="seeRowTotal" userInput="{{rowTotal}}" selector="{{AdminInvoiceItemsOrderedSection.itemTotalByName(product.name)}}"/>
    </actionGroup>
</actionGroups>
