|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="RegisteredPaypalCheckoutWithFlatRatePaymentActionSaleTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Registered Checkout Using PayPal Smart Button and Flat Rate (Payment Action = Sale)"/> |
| 14 | + <title value="Registered Checkout Using PayPal Smart Button and Flat Rate (Payment Action = Sale)"/> |
| 15 | + <description value="Customer buy Gift Card Product and checkout using paypal express with flat rates and payment action is sale"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-5037"/> |
| 18 | + <group value="3rd_party_integration"/> |
| 19 | + <!-- <group value="pr_exclude"/>--> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 23 | + <!-- Enable Flat rate --> |
| 24 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 25 | + <!-- Create Category --> |
| 26 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createProduct"> |
| 28 | + <field key="price">10</field> |
| 29 | + <requiredEntity createDataKey="createCategory"/> |
| 30 | + </createData> |
| 31 | + <!-- Enabling PayPal Express Checkout --> |
| 32 | + <magentoCLI command="config:set {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.value}}" stepKey="setPaymentActionSale"/> |
| 33 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress"> |
| 34 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 35 | + </actionGroup> |
| 36 | + <!-- New Customer --> |
| 37 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"> |
| 38 | + <field key="firstname">John1</field> |
| 39 | + <field key="lastname">Doe1</field> |
| 40 | + </createData> |
| 41 | + </before> |
| 42 | + <after> |
| 43 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 44 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 45 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 46 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 47 | + <!-- Delete Product --> |
| 48 | + <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> |
| 49 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 50 | + </after> |
| 51 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser"> |
| 52 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 53 | + </actionGroup> |
| 54 | + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="navigateToCategoryPage"/> |
| 55 | + <actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart"> |
| 56 | + <argument name="productName" value="$$createProduct.name$$"/> |
| 57 | + </actionGroup> |
| 58 | + <!-- Open mini cart--> |
| 59 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickMiniCart"/> |
| 60 | + <!--proceed to checkout --> |
| 61 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> |
| 62 | + |
| 63 | + |
| 64 | + <!-- Verify Shipping address--> |
| 65 | + <grabTextFrom selector="{{CheckoutShippingSection.savedAddress}}" stepKey="grabAddress"/> |
| 66 | + <!-- Assert the value of created customer attribute in shipping address block of checkout page--> |
| 67 | + <assertStringContainsString stepKey="assertCustomerAddresAttribute"> |
| 68 | + <actualResult type="variable">$grabAddress</actualResult> |
| 69 | + <expectedResult type="string">{{US_Address_TX.street[0]}}</expectedResult> |
| 70 | + </assertStringContainsString> |
| 71 | + <!-- Select Flat rate and click Next--> |
| 72 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/> |
| 73 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> |
| 74 | + <!--Assert grand total--> |
| 75 | + <actionGroup ref="VerifyCheckoutPaymentOrderSummaryActionGroup" stepKey="verifyCheckoutPaymentOrderSummary"> |
| 76 | + <argument name="orderSummarySubTotal" value="$10.00"/> |
| 77 | + <argument name="orderSummaryShippingTotal" value="$5.00"/> |
| 78 | + <argument name="orderSummaryTotal" value="$15.00"/> |
| 79 | + </actionGroup> |
| 80 | + <!-- Click on PayPal payment radio button --> |
| 81 | + <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/> |
| 82 | + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/> |
| 83 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 84 | + <!-- Login to Paypal in-context and verify order total on paypal page--> |
| 85 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 86 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 87 | + <waitForPageLoad stepKey="waitForPagePlacingOrderSuccessfully" /> |
| 88 | + <!--See success messages--> |
| 89 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForSuccessTitle"/> |
| 90 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 91 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> |
| 92 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 93 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 94 | + <!-- Go to order page --> |
| 95 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> |
| 96 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 97 | + </actionGroup> |
| 98 | + <!-- Check order status --> |
| 99 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> |
| 100 | + <argument name="status" value="Processing"/> |
| 101 | + </actionGroup> |
| 102 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 103 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 104 | + <!-- Check grand total --> |
| 105 | + <waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$15.00" stepKey="checkGrandTotal"/> |
| 106 | + <!-- Check comment history --> |
| 107 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 108 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $15.00 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotes"/> |
| 109 | + </test> |
| 110 | +</tests> |
0 commit comments