|
| 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="AdminCheckConfigPaymentsProInUnitedstatesTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Check config for payments pro in Unites States"/> |
| 15 | + <description value="Check paypal payments pro payment option's enablement and disablement based on the configuration setting For Payments Pro in backend"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4790"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 21 | + <createData entity="SimpleProduct" stepKey="simpleProduct"/> |
| 22 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 27 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountryAsUS"/> |
| 28 | + <magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePayPalPaymentsPro"/> |
| 29 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 30 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 31 | + </after> |
| 32 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> |
| 33 | + <waitForPageLoad stepKey="waitForConfigPageLoad"/> |
| 34 | + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab1('us')}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab('us')}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> |
| 35 | + <conditionalClick selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions('us')}}" dependentSelector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions('us')}}" visible="true" stepKey="clickPayPalPaymentsSection"/> |
| 36 | + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertPayLink"/> |
| 37 | + <actionGroup ref="AdminAssetForPayallInOneActionGroup" stepKey="AssertPayAllInOneLink"/> |
| 38 | + <!--Clear paypal details config related data--> |
| 39 | + <actionGroup ref="AdminClearPaymentsProActionGroup" stepKey="clearExistingDataForPaymentsPro"/> |
| 40 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> |
| 41 | + <actionGroup ref="AdminAssertPaypalCreditPaymentsProActionGroup" stepKey="enablePaypalPaymentsPro"/> |
| 42 | + <!--Save Configuration--> |
| 43 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> |
| 44 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJobs"> |
| 45 | + <argument name="indices" value=""/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 48 | + <argument name="tags" value="config full_page"/> |
| 49 | + </actionGroup> |
| 50 | + <!--Login to storefront as guest customer--> |
| 51 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 52 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 53 | + <!--Add simple product--> |
| 54 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 55 | + <argument name="product" value="$simpleProduct$"/> |
| 56 | + </actionGroup> |
| 57 | + <!--Go to cart page--> |
| 58 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> |
| 59 | + <!--Open cart page and proceed to checkout--> |
| 60 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 61 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 62 | + <!--Fill Shipping Address--> |
| 63 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> |
| 64 | + <argument name="customer" value="$$createCustomer$$" /> |
| 65 | + <argument name="address" value="US_Address_TX"/> |
| 66 | + </actionGroup> |
| 67 | + <!-- Select shipping --> |
| 68 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatRate"> |
| 69 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 70 | + </actionGroup> |
| 71 | + <!-- Go to Order review --> |
| 72 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 73 | + <waitForPageLoad stepKey="waitForLoadingPaypalPaymentPage"/> |
| 74 | + <!-- Assert Payflow Edition, Paypal Pro and Paypal Credit Payment method --> |
| 75 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressCheckoutPayflowEdition"/> |
| 76 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Credit')}}" stepKey="assertPaypalCreditPaymentMethod"/> |
| 77 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" stepKey="assertPaypalPaymentsProPaymentMethod"/> |
| 78 | + <magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePaymentsPro"/> |
| 79 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/> |
| 80 | + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/> |
| 81 | + <waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/> |
| 82 | + <click selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/> |
| 83 | + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution('us')}}" stepKey="assertNoGreenTickMarkForEnableThisSolutionDropdown"/> |
| 84 | + <assertElementContainsAttribute stepKey="seePaypalCreditIsDisabled"> |
| 85 | + <expectedResult selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" attribute="disabled" type="string"></expectedResult> |
| 86 | + </assertElementContainsAttribute> |
| 87 | + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo"/> |
| 88 | + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.sortOrder('us')}}" stepKey="assertSortOrderFieldIsDisappeared"/> |
| 89 | + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault('us')}}" userInput="Yes" stepKey="seeValultIsSetAsNo"/> |
| 90 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> |
| 91 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/> |
| 92 | + <dontSee selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalPaymentIsAbsent"/> |
| 93 | + <!--Set Paypal Credit to No and assert the status--> |
| 94 | + <magentoCLI command="config:set payment/paypal_payment_pro/active 1" stepKey="enablePaymentsPro"/> |
| 95 | + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePayPalCreditPaymentMethod"/> |
| 96 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterEnablingPaypal"/> |
| 97 | + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoadAfterEnabling"/> |
| 98 | + <waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatusAfterEnabling"/> |
| 99 | + <click selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatusAfterEnabling"/> |
| 100 | + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown"/> |
| 101 | + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seeEnablePaypalCreditIsSetAsNo"/> |
| 102 | + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledVault('us')}}" stepKey="assertGreenTickMarkForEnableVaultDropdown"/> |
| 103 | + <!--Go to checkout page and assert paypal express checkout Payflow Edition and Credit Card option is present--> |
| 104 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsPresent"/> |
| 105 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressPayflowEdition"/> |
| 106 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" stepKey="creditcardPaymentsPro"/> |
| 107 | + </test> |
| 108 | +</tests> |
0 commit comments