|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 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="AdminConfigPaymentsAdvancedForPaypalCreditTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PayPal"/> |
| 13 | + <stories value="Payment methods"/> |
| 14 | + <title value="Check config for PayPal Credit in Unites States"/> |
| 15 | + <description value="Check paypal Credit payment option's enablement and disablement based on the configuration setting in backend"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-5151"/> |
| 18 | + <group value="3rd_party_integration" /> |
| 19 | + <group value="pr_exclude" /> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="simpleProduct"/> |
| 24 | + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + </before> |
| 27 | + <after> |
| 28 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 29 | + <magentoCLI command="config:set paypal/general/merchant_country 0" stepKey="setMerchantCountryAsUS"/> |
| 30 | + <magentoCLI command="config:set payment/payflow_advanced/active 0" stepKey="disablePaymentsAdvanced"/> |
| 31 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 32 | + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> |
| 33 | + </after> |
| 34 | + <!--Admin navigate to payment configuration page and assert no other paypal payment is enabled--> |
| 35 | + <actionGroup ref="AdminAssertPaypalAllInOnePaymentMethodActionGroup" stepKey="configPaymentsAdvanced"/> |
| 36 | + <!--Clear paypal credit config related data--> |
| 37 | + <actionGroup ref="AdminClearPaymentAdvancedDataActionGroup" stepKey="clearPaymentsAdvanced"/> |
| 38 | + <!--Enable Payment Advanced and Paypal Credit--> |
| 39 | + <actionGroup ref="AdminEnablePaymentAdvancedConfigurationActionGroup" stepKey="enablePaymentsAdvanced"/> |
| 40 | + <!--Save Configuration--> |
| 41 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> |
| 42 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 43 | + <argument name="indices" value=""/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 46 | + <argument name="tags" value="config full_page"/> |
| 47 | + </actionGroup> |
| 48 | + <!--Login to storefront as guest customer--> |
| 49 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> |
| 50 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 51 | + <!--Add simple product--> |
| 52 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> |
| 53 | + <argument name="product" value="$simpleProduct$"/> |
| 54 | + </actionGroup> |
| 55 | + <!--Go to cart page--> |
| 56 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> |
| 57 | + <!--Open cart page and proceed to checkout--> |
| 58 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 59 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 60 | + <!--Fill Shipping Address--> |
| 61 | + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> |
| 62 | + <argument name="customer" value="$$createCustomer$$" /> |
| 63 | + <argument name="address" value="US_Address_TX"/> |
| 64 | + </actionGroup> |
| 65 | + <!-- Select shipping --> |
| 66 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatRate"> |
| 67 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 68 | + </actionGroup> |
| 69 | + <!-- Go to Order review --> |
| 70 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> |
| 71 | + <waitForPageLoad stepKey="waitForLoadingMask"/> |
| 72 | + <!-- Assert Paypal Advanced and Paypal Credit Payment method --> |
| 73 | + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowEdition}}" stepKey="assertPayflowEdition"/> |
| 74 | + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowExpress}}" stepKey="assertPayflowExpress"/> |
| 75 | + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvanced"/> |
| 76 | + <magentoCLI command="config:set payment/payflow_advanced/active 0" stepKey="disablePaymentAdvanced"/> |
| 77 | + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePaypalCredit"/> |
| 78 | + <magentoCLI command="config:set payment/payflow_express/active 0" stepKey="disableExpressCheckout"/> |
| 79 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/> |
| 80 | + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/> |
| 81 | + <waitForElementClickable selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/> |
| 82 | + <click selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/> |
| 83 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.greenCheckMrk('us')}}" stepKey="assertGreenTickMarkAbsentForEnableThisSolutionDropdown"/> |
| 84 | + <assertElementContainsAttribute stepKey="seePaypalCreditIsDisabled"> |
| 85 | + <expectedResult selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" attribute="disabled" type="string"></expectedResult> |
| 86 | + </assertElementContainsAttribute> |
| 87 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkAbsentForEnablePaypalCreditDropdown"/> |
| 88 | + <seeOptionIsSelected selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo"/> |
| 89 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.sortOrder('us')}}" stepKey="assertSortOrderFieldIsDisappeared"/> |
| 90 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> |
| 91 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache1"> |
| 92 | + <argument name="tags" value="config full_page"/> |
| 93 | + </actionGroup> |
| 94 | + <waitForElementNotVisible selector="{{AdminPayPalPayFlowLinkConfigSection.closeButton('us')}}" stepKey="assertConfigureBtnIsDisabled"/> |
| 95 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/> |
| 96 | + <!-- Assert Again Paypal Advanced and Paypal Credit Payment method --> |
| 97 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowEdition}}" stepKey="assertPayflowEditionNptTobeDisplayed"/> |
| 98 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowExpress}}" stepKey="assertPayPalCreditNotTobeDisplayed"/> |
| 99 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvancedNotToBeDisplayed"/> |
| 100 | + <actionGroup ref="AdminConfigPaymentAdvancedThroughCLIActionGroup" stepKey="configurePaymentAdvancedAndPayFlowEdition"/> |
| 101 | + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disableAgainPaypalCredit"/> |
| 102 | + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckoutAgain"/> |
| 103 | + <waitForPageLoad stepKey="waitForPaymentPageToLoad"/> |
| 104 | + <waitForElementClickable selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus1"/> |
| 105 | + <click selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus1"/> |
| 106 | + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.greenCheckMrk('us')}}" stepKey="assertAgainGreenTickMarkPresentEnableThisSolutionDropdown1"/> |
| 107 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkAbsentForEnablePaypalCreditDropdown1"/> |
| 108 | + <seeOptionIsSelected selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo1"/> |
| 109 | + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration1"/> |
| 110 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache2"> |
| 111 | + <argument name="tags" value="config full_page"/> |
| 112 | + </actionGroup> |
| 113 | + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.closeButton('us')}}" stepKey="assertConfigBtnIsDisabled"/> |
| 114 | + <!--Go to checkout page and assert paypal express checkout option is present--> |
| 115 | + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodsPresent"/> |
| 116 | + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvancedInStorefront"/> |
| 117 | + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressCheckoutPayflowEdition2"/> |
| 118 | + </test> |
| 119 | +</tests> |
0 commit comments