|
| 1 | +<!-- |
| 2 | + /** |
| 3 | + * Copyright © Magento, Inc. All rights reserved. |
| 4 | + * See COPYING.txt for license details. |
| 5 | + */ |
| 6 | +--> |
| 7 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 8 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="AdminPaypalExpressCheckoutWithAPICredentialsFromCheckoutPageTest"> |
| 10 | + <annotations> |
| 11 | + <features value="PayPal"/> |
| 12 | + <stories value="Payment methods"/> |
| 13 | + <title value="Enable Paypal Express Checkout with API credentials and validate Paypal Express checkout working from Checkout Page."/> |
| 14 | + <description value="Enable Paypal Express Checkout with API credentials and validate Paypal Express checkout working from Checkout Page."/> |
| 15 | + <severity value="MAJOR"/> |
| 16 | + <testCaseId value="AC-5206"/> |
| 17 | + <group value="3rd_party_integration"/> |
| 18 | + <group value="pr_exclude"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleProduct" stepKey="simpleProduct"/> |
| 22 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 23 | + <magentoCLI command="config:set {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.path}} {{StorefrontPaypalExpressOrderPaymentActionOptionConfigData.value}}" stepKey="setPaymentActionOrder"/> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 25 | + <!--Add new tax rates. Go to tax rule page --> |
| 26 | + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> |
| 27 | + <waitForElementVisible selector="{{AdminTaxRulesSection.ruleName}}" stepKey="waitForRuleName"/> |
| 28 | + <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRule.name}}"/> |
| 29 | + <!-- Adding product rate tax for NY --> |
| 30 | + <actionGroup ref="AddNewTaxRateNoZipUIActionGroup" stepKey="addProductTaxRateForCA"> |
| 31 | + <argument name="taxCode" value="SimpleTaxTexas"/> |
| 32 | + </actionGroup> |
| 33 | + <!-- Save Tax Rule --> |
| 34 | + <actionGroup ref="ClickSaveButtonActionGroup" stepKey="saveAnotherTaxRule"> |
| 35 | + <argument name="message" value="You saved the tax rule."/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="configPayPalExpress"> |
| 38 | + <argument name="credentials" value="SamplePaypalExpressConfig2"/> |
| 39 | + </actionGroup> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/> |
| 43 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 44 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 45 | + <!-- Go to the tax rule page and delete the row created--> |
| 46 | + <actionGroup ref="AdminTaxRuleGridOpenPageActionGroup" stepKey="goToTaxRulesPageA"/> |
| 47 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule"> |
| 48 | + <argument name="name" value="{{TaxRule.name}}"/> |
| 49 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> |
| 50 | + </actionGroup> |
| 51 | + <!-- Deleting Tax zones and rate for Product Tax --> |
| 52 | + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresTaxZonesAndRatesPage"> |
| 53 | + <argument name="menuUiId" value="{{AdminMenuStores.dataUiId}}"/> |
| 54 | + <argument name="submenuUiId" value="{{AdminMenuStoresTaxZonesAndRates.dataUiId}}"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteProductTaxRule1"> |
| 57 | + <argument name="name" value="{{SimpleTaxTexas.identifier}}-{{SimpleTaxTexas.rate}}"/> |
| 58 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> |
| 59 | + </actionGroup> |
| 60 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 61 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> |
| 62 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 63 | + </after> |
| 64 | + |
| 65 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 66 | + <argument name="indices" value=""/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 69 | + <argument name="tags" value="config full_page"/> |
| 70 | + </actionGroup> |
| 71 | + |
| 72 | + <!--Go to storefront and add product to cart --> |
| 73 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 74 | + <argument name="Customer" value="$createCustomer$" /> |
| 75 | + </actionGroup> |
| 76 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> |
| 77 | + <argument name="product" value="$$simpleProduct$$"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart"> |
| 80 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 81 | + </actionGroup> |
| 82 | + <actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutPage"/> |
| 83 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRate"> |
| 84 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Go to Order review --> |
| 87 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 88 | + <waitForElementClickable selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="waitForPayPalExpressCheckoutIsPresent"/> |
| 89 | + <click selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="clickPayPalExpressCheckout"/> |
| 90 | + <waitForPageLoad stepKey="waitForPaypalExpressCheckoutToBeLoaded"/> |
| 91 | + <!-- Click on Paypal paypal button--> |
| 92 | + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> |
| 93 | + <!--Login to Paypal in-context--> |
| 94 | + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> |
| 95 | + <!--Transfer Cart Line and Shipping Method assertion--> |
| 96 | + <actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/> |
| 97 | + <!--Click PayPal button and go back to Magento site--> |
| 98 | + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="goBackToMagentoSite"/> |
| 99 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/> |
| 100 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForLoadSuccessPage"/> |
| 101 | + <!--Grab order number--> |
| 102 | + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderNumberToBeGrabbed"/> |
| 103 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/> |
| 104 | + <!--Go to admin sales page and open the order id--> |
| 105 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> |
| 106 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 107 | + </actionGroup> |
| 108 | + <!-- Check status --> |
| 109 | + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> |
| 110 | + <argument name="status" value="Processing"/> |
| 111 | + </actionGroup> |
| 112 | + <!--Open Invoice--> |
| 113 | + <waitForElementClickable selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="waitForInvoicesTabClickable" /> |
| 114 | + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="openInvoicesTab"/> |
| 115 | + <!--Check Invoice Section --> |
| 116 | + <waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoiceTabContent}}" stepKey="waitForInvoiceSectionContentToBeAppeared"/> |
| 117 | + </test> |
| 118 | +</tests> |
0 commit comments