|
| 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 | + <!-- Enabling PayPal Express Checkout --> |
| 28 | + <magentoCLI command="config:set {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressSalePaymentActionOptionConfigData.value}}" stepKey="setPaymentActionSale"/> |
| 29 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress"> |
| 30 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 31 | + </actionGroup> |
| 32 | + <!-- New Customer --> |
| 33 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"> |
| 34 | + <field key="firstname">John1</field> |
| 35 | + <field key="lastname">Doe1</field> |
| 36 | + </createData> |
| 37 | + </before> |
| 38 | + <after> |
| 39 | + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> |
| 40 | + <argument name="sku" value="{{GiftCard.sku}}"/> |
| 41 | + </actionGroup> |
| 42 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 43 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 44 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" /> |
| 45 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 46 | + <!-- Delete Product --> |
| 47 | + <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> |
| 48 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 49 | + </after> |
| 50 | + <!-- Create gift card product --> |
| 51 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> |
| 52 | + <waitForPageLoad stepKey="waitForCatalogProductGrid"/> |
| 53 | + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> |
| 54 | + <argument name="productType" value="giftcard"/> |
| 55 | + </actionGroup> |
| 56 | + <!-- Fill gift card product values --> |
| 57 | + <actionGroup ref="AdminFillGiftCardProductFieldsActionGroup" stepKey="fillGiftCardProductFields"> |
| 58 | + <argument name="product" value="GiftCard"/> |
| 59 | + </actionGroup> |
| 60 | + <!-- Add amount to gift card product --> |
| 61 | + <actionGroup ref="addGiftCardAmount" stepKey="addAmountToGiftCard"> |
| 62 | + <argument name="giftCardAmount" value="GiftCard.amounts[0]"/> |
| 63 | + </actionGroup> |
| 64 | + <!-- Add gift card product to category --> |
| 65 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="addAmountToGiftCard"/> |
| 66 | + <!-- Save gift card product --> |
| 67 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 68 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser"> |
| 69 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 70 | + </actionGroup> |
| 71 | + <!-- Quick search gift card product --> |
| 72 | + <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForGiftCardProduct"> |
| 73 | + <argument name="phrase" value="GiftCard.sku"/> |
| 74 | + </actionGroup> |
| 75 | + <!-- Go to gift card product page on storefront --> |
| 76 | + <seeElement selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="seeProductsInCategory"/> |
| 77 | + <waitForElementClickable selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="waitForProductClickable"/> |
| 78 | + <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openProduct"/> |
| 79 | + <!-- Enter Sender's and recipient name --> |
| 80 | + <actionGroup ref="StorefrontFillGiftCardPhysicalProductFormActionGroup" stepKey="addDetailsOfGiftCard"/> |
| 81 | + <!-- Add product to cart--> |
| 82 | + <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> |
| 83 | + <!-- Open mini cart from product page and proceed to checkout --> |
| 84 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 85 | + <!-- Verify Shipping address--> |
| 86 | + <grabTextFrom selector="{{CheckoutShippingSection.savedAddress}}" stepKey="grabAddress"/> |
| 87 | + <!-- Assert the value of created customer attribute in shipping address block of checkout page--> |
| 88 | + <assertStringContainsString stepKey="assertCustomerAddresAttribute"> |
| 89 | + <actualResult type="variable">$grabAddress</actualResult> |
| 90 | + <expectedResult type="string">{{US_Address_TX.street[0]}}</expectedResult> |
| 91 | + </assertStringContainsString> |
| 92 | + <!-- Select Flat rate and click Next--> |
| 93 | + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/> |
| 94 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> |
| 95 | + <!--Assert grand total--> |
| 96 | + <actionGroup ref="VerifyCheckoutPaymentOrderSummaryActionGroup" stepKey="verifyCheckoutPaymentOrderSummary"> |
| 97 | + <argument name="orderSummarySubTotal" value="$10.00"/> |
| 98 | + <argument name="orderSummaryShippingTotal" value="$5.00"/> |
| 99 | + <argument name="orderSummaryTotal" value="$15.00"/> |
| 100 | + </actionGroup> |
| 101 | + <!-- Click on PayPal payment radio button --> |
| 102 | + <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/> |
| 103 | + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/> |
| 104 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 105 | + <!-- Login to Paypal in-context and verify order total on paypal page--> |
| 106 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 107 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> |
| 108 | + <waitForPageLoad stepKey="waitForPagePlacingOrderSuccessfully" /> |
| 109 | + <!--See success messages--> |
| 110 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForSuccessTitle"/> |
| 111 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 112 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order number is: " stepKey="seeOrderNumber"/> |
| 113 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 114 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 115 | + <!-- Go to order page --> |
| 116 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> |
| 117 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 118 | + </actionGroup> |
| 119 | + <!-- Check order status --> |
| 120 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> |
| 121 | + <argument name="status" value="Processing"/> |
| 122 | + </actionGroup> |
| 123 | + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForLastTransactionIDFieldToBeAppearedAfterSubmittingInvoice"/> |
| 124 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionIDForCaptured"/> |
| 125 | + <!-- Check grand total --> |
| 126 | + <waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$15.00" stepKey="checkGrandTotal"/> |
| 127 | + <!-- Check comment history --> |
| 128 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 129 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Captured amount')}}" userInput="Captured amount of $15.00 online. Transaction ID: "{$grabLastTransactionIDForCaptured}"" stepKey="seeOrderHistoryNotes"/> |
| 130 | + <!-- Go to invoice tab and verify invoice is present--> |
| 131 | + <actionGroup ref="AdminOpenInvoiceTabFromOrderPageActionGroup" stepKey="clickInvoicesTabOrdersPage"/> |
| 132 | + <waitForElementVisible selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="waitForInvoicesTabOpenedOne"/> |
| 133 | + <seeElement selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="seeForInvoicesTabOpenedOne"/> |
| 134 | + </test> |
| 135 | +</tests> |
0 commit comments