Skip to content

Commit a533218

Browse files
committed
ACQE-6571:Check config for payments pro in Unites States
Updated on Testcases
1 parent fd80c67 commit a533218

File tree

4 files changed

+57
-13
lines changed

4 files changed

+57
-13
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertOtherPaypalPaymentSolutionActionGroup">
12+
<annotations>
13+
<description>Admin navigate to payment configuration page and assert Other Paypal Payment Solution</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="countryCode" type="string" defaultValue="us"/>
17+
</arguments>
18+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
19+
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
20+
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab1(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
21+
<conditionalClick selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" dependentSelector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" visible="false" stepKey="clickPayPalPaymentsSection"/>
22+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" stepKey="assertPayinAllLink"/>
23+
<waitForElementVisible selector="{{AdminPayPalPayFlowLinkConfigSection.paymentGateway(countryCode)}}" stepKey="assertPaypalPaymentGateway"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssetForPayallInOneActionGroup.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,15 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AdminAssetForPayallInOneActionGroup">
11+
<actionGroup name="AdminAssetForPayallInOneActionGroup" extends="AdminAssertOtherPaypalPaymentSolutionActionGroup">
1212
<annotations>
1313
<description>Admin navigate to payment configuration page and assert Pay All In One Link and Other Payment Services</description>
1414
</annotations>
1515
<arguments>
1616
<argument name="countryCode" type="string" defaultValue="us"/>
1717
</arguments>
18-
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
19-
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
20-
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab1(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
21-
<conditionalClick selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" dependentSelector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" visible="false" stepKey="clickPayPalPaymentsSection"/>
22-
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions(countryCode)}}" stepKey="assertPayinAllLink"/>
23-
<waitForElementVisible selector="{{AdminPayPalPayFlowLinkConfigSection.paymentGateway(countryCode)}}" stepKey="assertPaypalPaymentGateway"/>
24-
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.paymentsAdvanced(countryCode)}}" stepKey="assertPaymentAdvanced"/>
25-
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="assertPaymentsPro"/>
26-
<waitForElementVisible selector="{{AdminPaypalStandardConfigSection.configureBtn(countryCode)}}" stepKey="assertPaymentStandard"/>
18+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.paymentsAdvanced(countryCode)}}" stepKey="assertPaymentAdvanced" after="assertPayinAllLink"/>
19+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="assertPaymentsPro" after="assertPaymentAdvanced"/>
20+
<waitForElementVisible selector="{{AdminPaypalStandardConfigSection.configureBtn(countryCode)}}" stepKey="assertPaymentStandard" after="assertPaymentsPro"/>
2721
</actionGroup>
2822
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentsProActionGroup.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,17 @@
2727
<clearField selector="{{PayPalPaymentsProConfigSection.user(countryCode)}}" stepKey="clearInputUsereField"/>
2828
<clearField selector="{{PayPalPaymentsProConfigSection.password(countryCode)}}" stepKey="clearInputPasswordField"/>
2929
<selectOption selector="{{PayPalPaymentsProConfigSection.testMode(countryCode)}}" userInput="No" stepKey="disableTestMode"/>
30+
<assertElementContainsAttribute stepKey="seeEnablePaymentsProSolutionIsDisabled">
31+
<expectedResult selector="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" attribute="disabled" type="string"></expectedResult>
32+
</assertElementContainsAttribute>
33+
<seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo"/>
34+
<assertElementContainsAttribute stepKey="seeEnablePaypalCreditIsDisabled">
35+
<expectedResult selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" attribute="disabled" type="string"></expectedResult>
36+
</assertElementContainsAttribute>
37+
<seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo" after="seeEnablePaypalCreditIsDisabled"/>
38+
<assertElementContainsAttribute stepKey="seeEnableVaultIsDisabled">
39+
<expectedResult selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" attribute="disabled" type="string"></expectedResult>
40+
</assertElementContainsAttribute>
41+
<seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" userInput="No" stepKey="seeValultIsSetAsNo" after="seeEnableVaultIsDisabled"/>
3042
</actionGroup>
3143
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckConfigPaymentsProInUnitedstatesTest.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
<before>
2020
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
2121
<createData entity="SimpleProduct" stepKey="simpleProduct"/>
22+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJobs1">
23+
<argument name="indices" value=""/>
24+
</actionGroup>
25+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache1">
26+
<argument name="tags" value="config full_page"/>
27+
</actionGroup>
28+
<!-- Verify Product On Storefront Page -->
29+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
30+
<argument name="product" value="$$simpleProduct$$"/>
31+
</actionGroup>
2232
<magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/>
2333
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2434
</before>
@@ -31,9 +41,11 @@
3141
</after>
3242
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
3343
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
44+
<!--Assert Section Available in Other Paypal Payment Solution Link-->
3445
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab1('us')}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab('us')}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
3546
<conditionalClick selector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions('us')}}" dependentSelector="{{PayPalPaymentsProConfigSection.paypalAllInOnePaymentSolutions('us')}}" visible="true" stepKey="clickPayPalPaymentsSection"/>
36-
<waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertPayLink"/>
47+
<waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertPaymentsProConfigBtn"/>
48+
<actionGroup ref="AdminAssertOtherPaypalPaymentSolutionActionGroup" stepKey="AssertOtherPaypalPaymentSolutionLink"/>
3749
<actionGroup ref="AdminAssetForPayallInOneActionGroup" stepKey="AssertPayAllInOneLink"/>
3850
<!--Clear paypal details config related data-->
3951
<actionGroup ref="AdminClearPaymentsProActionGroup" stepKey="clearExistingDataForPaymentsPro"/>
@@ -47,15 +59,14 @@
4759
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
4860
<argument name="tags" value="config full_page"/>
4961
</actionGroup>
62+
<waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertConfigureBtnNotVisible"/>
5063
<!--Login to storefront as guest customer-->
5164
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
5265
<waitForPageLoad stepKey="waitForProductPage"/>
5366
<!--Add simple product-->
5467
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
5568
<argument name="product" value="$simpleProduct$"/>
5669
</actionGroup>
57-
<!--Go to cart page-->
58-
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/>
5970
<!--Open cart page and proceed to checkout-->
6071
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
6172
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
@@ -88,13 +99,15 @@
8899
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.sortOrder('us')}}" stepKey="assertSortOrderFieldIsDisappeared"/>
89100
<seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault('us')}}" userInput="Yes" stepKey="seeValultIsSetAsNo"/>
90101
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/>
102+
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="assertConfigureVisible"/>
91103
<actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/>
92104
<dontSee selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalPaymentIsAbsent"/>
93105
<!--Set Paypal Credit to No and assert the status-->
94106
<magentoCLI command="config:set payment/paypal_payment_pro/active 1" stepKey="enablePaymentsPro"/>
95107
<magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePayPalCreditPaymentMethod"/>
96108
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterEnablingPaypal"/>
97109
<waitForPageLoad stepKey="waitForPaymentMethodPageToLoadAfterEnabling"/>
110+
<waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertConfigeBtnNotVisible"/>
98111
<waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatusAfterEnabling"/>
99112
<click selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatusAfterEnabling"/>
100113
<waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown"/>

0 commit comments

Comments
 (0)