<commit_before><?xml version="1.0" encoding="UTF-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
    <test name="AmazonCheckoutMulticurrencySuccessV2" extends="AmazonCheckoutButtonV2">
        <annotations>
            <stories value="Amazon Checkout Multicurrency"/>
            <title value="Amazon Checkout Multicurrency Success V2"/>
            <description value="User should be able to checkout with Amazon Pay when multicurrency is enabled and they are using a supported currency."/>
            <severity value="CRITICAL"/>
            <group value="amazon_pay_v2"/>
            <group value="amazon_pay_v2_checkout"/>
            <group value="amazon_pay_v2_multicurrency"/>
        </annotations>

        <before>
            <createData entity="EUAmazonPaymentV2Config" stepKey="SampleAmazonPaymentV2ConfigData" before="flushCache"/>
            <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig" before="flushCache"/>
            <!-- set default currency to one supported for multicurrency -->
            <magentoCLI command="config:set currency/options/default USD" stepKey="setDefaultCurrency" before="flushCache"/>
            <!-- disable multicurrency -->
            <magentoCLI command="config:set payment/amazon_payment/multicurrency 1" stepKey="setMulticurrency" before="flushCache"/>
        </before>

        <after>
            <createData entity="SampleAmazonPaymentV2Config" stepKey="DefaultAmazonPaymentConfig"/>
            <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/>
            <magentoCLI command="cache:flush" stepKey="flushCache"/>
        </after>

        <!--Go to Amazon Pay from the checkout and login-->
        <click selector="{{AmazonButtonSection.v2Checkout}}" stepKey="clickAmazonButton"/>
        <actionGroup ref="AmazonLoginActionGroup" stepKey="AmazonLoginActionGroup"/>
        <!--Come back to checkout with default address-->
        <actionGroup ref="AmazonCheckoutActionGroup" stepKey="DefaultAmazonCheckoutActionGroup"/>
        <!--Go to payment method-->
        <click selector="{{CheckoutShippingSection.next}}" stepKey="clickCheckoutShippingNext"/>
        <waitForPageLoad stepKey="waitForCheckoutPaymentPageLoad"/>
        <!--Verify only Amazon Pay method is visible-->
        <seeNumberOfElements selector="{{CheckoutPaymentSection.availablePaymentSolutions}}" userInput="1" stepKey="seeSingleAvailablePaymentSolution"/>
        <seeElement selector="{{AmazonCheckoutSection.v2Method}}" stepKey="seeAmazonPaymentMethod"/>
        <!--Place order-->
        <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="guestPlaceorder">
            <argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage" />
            <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" />
        </actionGroup>
    </test>
</tests><commit_msg>APF-236 - Add invoice check to multicurrency MFTF test<commit_after><?xml version="1.0" encoding="UTF-8"?>
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
    <test name="AmazonCheckoutMulticurrencySuccessV2" extends="AmazonCheckoutButtonV2">
        <annotations>
            <stories value="Amazon Checkout Multicurrency"/>
            <title value="Amazon Checkout Multicurrency Success V2"/>
            <description value="User should be able to checkout with Amazon Pay when multicurrency is enabled and they are using a supported currency."/>
            <severity value="CRITICAL"/>
            <group value="amazon_pay_v2"/>
            <group value="amazon_pay_v2_checkout"/>
            <group value="amazon_pay_v2_multicurrency"/>
        </annotations>

        <before>
            <createData entity="EUAmazonPaymentV2Config" stepKey="SampleAmazonPaymentV2ConfigData" before="flushCache"/>
            <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig" before="flushCache"/>
            <!-- set default currency to one supported for multicurrency -->
            <magentoCLI command="config:set currency/options/default USD" stepKey="setDefaultCurrency" before="flushCache"/>
            <!-- disable multicurrency -->
            <magentoCLI command="config:set payment/amazon_payment/multicurrency 1" stepKey="setMulticurrency" before="flushCache"/>
        </before>

        <after>
            <createData entity="SampleAmazonPaymentV2Config" stepKey="DefaultAmazonPaymentConfig"/>
            <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/>
            <magentoCLI command="cache:flush" stepKey="flushCache"/>
        </after>

        <!--Go to Amazon Pay from the checkout and login-->
        <click selector="{{AmazonButtonSection.v2Checkout}}" stepKey="clickAmazonButton"/>
        <actionGroup ref="AmazonLoginActionGroup" stepKey="AmazonLoginActionGroup"/>
        <!--Come back to checkout with default address-->
        <actionGroup ref="AmazonCheckoutActionGroup" stepKey="DefaultAmazonCheckoutActionGroup"/>
        <!--Go to payment method-->
        <click selector="{{CheckoutShippingSection.next}}" stepKey="clickCheckoutShippingNext"/>
        <waitForPageLoad stepKey="waitForCheckoutPaymentPageLoad"/>
        <!--Verify only Amazon Pay method is visible-->
        <seeNumberOfElements selector="{{CheckoutPaymentSection.availablePaymentSolutions}}" userInput="1" stepKey="seeSingleAvailablePaymentSolution"/>
        <seeElement selector="{{AmazonCheckoutSection.v2Method}}" stepKey="seeAmazonPaymentMethod"/>
        <!--Place order-->
        <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="guestPlaceorder">
            <argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage" />
            <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" />
        </actionGroup>
        <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>

        <!-- Login as admin -->
        <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

        <!-- Open created order in backend -->
        <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/>
        <waitForPageLoad stepKey="waitForOrdersPageLoad"/>
        <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
            <argument name="orderId" value="$grabOrderNumber"/>
        </actionGroup>

        <!-- Create Invoice -->
        <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/>
        <waitForPageLoad stepKey="waitForInvoicePage"/>

        <!-- Verify invoice item qtys cannot be changed -->
        <dontSeeElement stepKey="dontSeeItemQtyToInvoice1" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}"/>
        <dontSeeElement stepKey="dontSeeItemQtyToInvoice2" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}"/>
        <dontSeeElement stepKey="dontSeeUpdateQty" selector="{{AdminInvoiceItemsSection.updateQty}}"/>

        <!-- Submit and verify the invoice created using the presentmentCurrency -->
        <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/>
        <waitForPageLoad stepKey="waitForLoadPage"/>
        <see userInput="The invoice has been created." stepKey="seeMessage"/>
        <see userInput="Captured amount of €6.23 [$8.82] online." stepKey="seeCapturedAmount"/>
    </test>
</tests>
{'fraction_non_alphanumeric': 0.1213744447347792, 'fraction_numerical': 0.00718578521034753, 'mean_word_length': 3.857233502538071, 'pattern_counts': {'":': 0, '<': 110, '<?xml version=': 2, '>': 110, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6001080', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1972, 'n_words': 395}