<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="AmazonCheckoutSuccess" extends="AmazonCheckoutButton">
        <annotations>
            <stories value="Amazon Checkout"/>
            <title value="Amazon Checkout Success"/>
            <description value="User should be able to checkout with Amazon Pay."/>
            <severity value="CRITICAL"/>
            <group value="amazon_pay"/>
            <group value="amazon_pay_checkout"/>
        </annotations>

        <!--Go to Amazon Pay from the checkout and login-->
        <actionGroup ref="AmazonLoginAndCheckoutActionGroup" stepKey="AmazonLoginAndCheckoutActionGroup"/>
        <!--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.method}}" 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="orderNumber" />
        <magentoCLI command="amazon:payment:sales:verify-charge-permission" arguments="--orderId {$orderNumber}" stepKey="command" />
        <assertEquals stepKey="refIdAssert">
            <actualResult type="string">${command}</actualResult>
            <expectedResult type="string">true\n</expectedResult>
        </assertEquals>
    </test>
</tests>
<commit_msg>Account for whitespace/newline trimming on responses from MagentoWebDriver's magentoCLI() function<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="AmazonCheckoutSuccess" extends="AmazonCheckoutButton">
        <annotations>
            <stories value="Amazon Checkout"/>
            <title value="Amazon Checkout Success"/>
            <description value="User should be able to checkout with Amazon Pay."/>
            <severity value="CRITICAL"/>
            <group value="amazon_pay"/>
            <group value="amazon_pay_checkout"/>
        </annotations>

        <!--Go to Amazon Pay from the checkout and login-->
        <actionGroup ref="AmazonLoginAndCheckoutActionGroup" stepKey="AmazonLoginAndCheckoutActionGroup"/>
        <!--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.method}}" 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="orderNumber" />
        <magentoCLI command="amazon:payment:sales:verify-charge-permission" arguments="--orderId {$orderNumber}" stepKey="command" />
        <assertStringContainsString stepKey="seeMerchantReferenceIdMatchesOrderNumber">
            <expectedResult type="string">true</expectedResult>
            <actualResult type="string">${command}</actualResult>
        </assertStringContainsString>
    </test>
</tests>

{'fraction_non_alphanumeric': 0.12892066420664205, 'fraction_numerical': 0.004151291512915129, 'mean_word_length': 3.9736238532110093, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 2, '>': 71, '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': '3217943', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1096, 'n_words': 205}