|
| 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 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="GuestCheckoutWithPayPalButtonFromCheckoutPageFreeShippingTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Paypal"/> |
| 14 | + <stories value="PayPal Express Checkout"/> |
| 15 | + <title value="Guest checkout with PayPal button from Product page and use Free Shipping"/> |
| 16 | + <description value="Customer is able to buy goods using Checkout with PayPal button from Product page and use Free Shipping"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="AC-5210"/> |
| 19 | + <group value="3rd_party_integration"/> |
| 20 | + <group value="pr_exclude"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 26 | + <field key="price">10.00</field> |
| 27 | + </createData> |
| 28 | + <!-- Enabling PayPal Express Checkout --> |
| 29 | + <magentoCLI command="config:set {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressAuthorizationPaymentActionOptionConfigData.value}}" stepKey="setPaymentActionOrder"/> |
| 30 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress"> |
| 31 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 32 | + </actionGroup> |
| 33 | + <!-- Enable Free Shipping method --> |
| 34 | + <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> |
| 35 | + <!-- Create Tax Rule w/ NY & CA Tax Rates --> |
| 36 | + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRatesPage"/> |
| 37 | + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> |
| 38 | + <actionGroup ref="AdminGoToNewTaxRulePageActionGroup" stepKey="goToCreateTaxRulePage"/> |
| 39 | + <fillField selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{SimpleTaxRule.code}}" stepKey="fillRuleName"/> |
| 40 | + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> |
| 41 | + <argument name="taxCode" value="SimpleTaxNY"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> |
| 44 | + <argument name="taxCode" value="SimpleTaxCA"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="AdminSaveTaxRuleActionGroup" stepKey="saveTaxRule"/> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <!-- Delete Product --> |
| 50 | + <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> |
| 51 | + <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> |
| 52 | + <!-- Disable Free Shipping method --> |
| 53 | + <createData entity="FreeShippingMethodDisableConfig" stepKey="disableFreeShipping"/> |
| 54 | + <!-- Disable Paypal --> |
| 55 | + <actionGroup ref="AdminPayPalExpressCheckoutDisableActionGroup" stepKey="configPaypalExpressCheckoutDisable"/> |
| 56 | + <!-- Revert to default tax rate and rule --> |
| 57 | + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> |
| 58 | + <actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulesPage"/> |
| 59 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule"> |
| 60 | + <argument name="name" value="{{SimpleTaxRule.code}}"/> |
| 61 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRatesPage"/> |
| 64 | + <actionGroup ref="AdminDeleteMultipleTaxRatesActionGroup" stepKey="deleteAllNonDefaultTaxRates"/> |
| 65 | + <!-- Logout --> |
| 66 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 67 | + </after> |
| 68 | + <!-- Go to StoreFront --> |
| 69 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 70 | + <!-- Add simple product to cart --> |
| 71 | + <actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart"> |
| 72 | + <argument name="product" value="$$createProduct$$"/> |
| 73 | + <argument name="quantity" value="1"/> |
| 74 | + </actionGroup> |
| 75 | + <!-- Open mini cart from product page --> |
| 76 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniShoppingCart"/> |
| 77 | + <!--Click Paypal button--> |
| 78 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 79 | + <!--Login to Paypal in-context--> |
| 80 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 81 | + <!--Select US shipping address--> |
| 82 | + <actionGroup ref="SelectShippingAddressOnPayPalPaymentPageActionGroup" stepKey="selectUSShippingAddress"> |
| 83 | + <argument name="address" value="ShippingAddressUS"/> |
| 84 | + </actionGroup> |
| 85 | + <!--Click PayPal button and go back to Magento site--> |
| 86 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="ClickContinueGoBackToMagentoSite"/> |
| 87 | + <!--Select free shipping--> |
| 88 | + <actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod"> |
| 89 | + <argument name="shippingMethod" value="Free - $0.00"/> |
| 90 | + </actionGroup> |
| 91 | + <!--Assert grand total--> |
| 92 | + <actionGroup ref="StorefrontAssertOrderReviewSummaryWithTaxActionGroup" stepKey="verifyCheckoutPaymentOrderSummary"> |
| 93 | + <argument name="orderSummarySubTotal" value="$10.00"/> |
| 94 | + <argument name="orderSummaryShippingTotal" value="$0.00"/> |
| 95 | + <argument name="orderSummaryTax" value="$0.83"/> |
| 96 | + <argument name="orderSummaryTotal" value="$10.83"/> |
| 97 | + </actionGroup> |
| 98 | + <!--SubmitOrder--> |
| 99 | + <actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/> |
| 100 | + <!--See success messages--> |
| 101 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 102 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 103 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 104 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> |
| 105 | + <!-- Go to order page --> |
| 106 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> |
| 107 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 108 | + </actionGroup> |
| 109 | + <!-- Check order status --> |
| 110 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> |
| 111 | + <argument name="status" value="Processing"/> |
| 112 | + </actionGroup> |
| 113 | + <!-- Check grand total --> |
| 114 | + <waitForText selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$10.83" stepKey="checkGrandTotal"/> |
| 115 | + <!-- Check comment history --> |
| 116 | + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> |
| 117 | + <waitForText selector="{{AdminOrderCommentsTabSection.orderComment}}" userInput="Authorized amount of $10.83." stepKey="seeOrderHistoryNotes"/> |
| 118 | + <!-- Check transaction tab and is closed values--> |
| 119 | + <actionGroup ref="AdminOpenOrderTransactionActionGroup" stepKey="clickOnTransactionTab"/> |
| 120 | + <waitForElementVisible selector="{{AdminOrderDetailsOrderViewSection.transactionTable('increment_id','{$grabOrderNumber}')}}" stepKey="verifyTransactionIsPresent"/> |
| 121 | + <waitForElementVisible selector="{{AdminOrderDetailsOrderViewSection.transactionTable('is_closed','No')}}" stepKey="verifyTransactionIsClosedValue"/> |
| 122 | + </test> |
| 123 | +</tests> |
0 commit comments