|
| 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="AdminCheckConfigurationForPayPalExpressCheckoutInUnitesStatesTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Check config for PayPal Express Checkout in Unites States"/> |
| 15 | + <description value="Check paypal express checkout payment option's enablement and disablement based on the configuration setting in backend."/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-5499"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="SimpleProduct" stepKey="simpleProduct"/> |
| 21 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountryAsUS"/> |
| 26 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpressAfterVerifyingInStorefront"/> |
| 27 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 28 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 29 | + </after> |
| 30 | + <!--Admin navigate to payment configuration page and assert no other paypal payment is enabled--> |
| 31 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationToAssertNoOtherPaypalPaymentServiceEnabled"/> |
| 32 | + <dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="assertNoOtherPaypalPaymentServiceEnabled"/> |
| 33 | + <!--Clear paypal express checkout config related data--> |
| 34 | + <actionGroup ref="AdminClearPayPalExpressCheckoutDataActionGroup" stepKey="clearPaypalExpressCheckoutConfigData"/> |
| 35 | + <!--Assert enable this solution is set to No and disabled--> |
| 36 | + <waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.enableSolution('us')}}" stepKey="waitForEnableThisSolutionField"/> |
| 37 | + <seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableSolution('us')}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo"/> |
| 38 | + <dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.disabledEnableSolution('us')}}" stepKey="seeEnableThisSolutionFieldIsDisabled"/> |
| 39 | + <!--Assert enable in-context checkout experience is set to No and disabled--> |
| 40 | + <waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" stepKey="waitForEnableInContextCheckoutExpField"/> |
| 41 | + <seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" userInput="No" stepKey="seeEnableEnableInContextCheckoutExperienceIsSetAsNo"/> |
| 42 | + <dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.disabledEnableInContextCheckoutExp('us')}}" stepKey="seeEnableInContextCheckoutExpFieldIsDisabled"/> |
| 43 | + <!--Go to Advanced settings -> Frontend Exp settings -> Features and see Paypal Credit option is not selected--> |
| 44 | + <scrollTo selector="{{PayPalExpressCheckoutConfigSection.recommendedSolution('us')}}" stepKey="scrollToRecommendedSolutionHeader"/> |
| 45 | + <waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="waitForCloseButtonToClick"/> |
| 46 | + <click selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="clickCloseButton"/> |
| 47 | + <actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeatures"/> |
| 48 | + <dontSeeOptionIsSelected selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="PayPal Credit" stepKey="dontSeePayPalCreditOptionIsSelected" /> |
| 49 | + <!--Enable paypal solution--> |
| 50 | + <actionGroup ref="AdminAssertEnableThisSolutionAndInContextCheckoutValueActionGroup" stepKey= "adminConfigPaypalExpressCheckout"/> |
| 51 | + <!--Go to storefront and add product to cart --> |
| 52 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> |
| 53 | + <argument name="product" value="$$simpleProduct$$"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart"> |
| 56 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 57 | + </actionGroup> |
| 58 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 59 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 60 | + <!--Place order--> |
| 61 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="asAGuestFillShippingAddress"> |
| 62 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 63 | + </actionGroup> |
| 64 | + <waitForPageLoad stepKey="waitForShippingMethodToLoad"/> |
| 65 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsPresent"/> |
| 66 | + <!--Disable Paypal express checkout and assert Merchant ID field is disappeared--> |
| 67 | + <magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpressAfterAssertingInStoreFront"/> |
| 68 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/> |
| 69 | + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/> |
| 70 | + <waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/> |
| 71 | + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/> |
| 72 | + <waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.merchantID('us')}}" stepKey="assertMerchantIDFieldIsDisappeared"/> |
| 73 | + <assertElementContainsAttribute stepKey="seeInContextCheckoutIsDisabled"> |
| 74 | + <expectedResult selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" attribute="disabled" type="string"></expectedResult> |
| 75 | + </assertElementContainsAttribute> |
| 76 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> |
| 77 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/> |
| 78 | + <dontSee selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsAbsent"/> |
| 79 | + <!--Set Paypal Express Checkout to No and assert its status--> |
| 80 | + <magentoCLI command="config:set payment/paypal_express/active 1" stepKey="enablePayPalExpress"/> |
| 81 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterEnablingPaypal"/> |
| 82 | + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoadAfterEnabling"/> |
| 83 | + <waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatusAfterEnabling"/> |
| 84 | + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatusAfterEnabling"/> |
| 85 | + <waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown"/> |
| 86 | + <!--Go to checkout page and assert paypal express checkout option is present--> |
| 87 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsPresent"/> |
| 88 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsPresent2"/> |
| 89 | + </test> |
| 90 | +</tests> |
0 commit comments