Skip to content

Commit b551cbe

Browse files
committed
Merge remote-tracking branch 'local/ACP2E-1303' into PR_7_JAN_2023
2 parents 62db9c1 + c7061cd commit b551cbe

11 files changed

+192
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup">
12+
<annotations>
13+
<description>Clicks on 'Configure' for 'PayPal Express Checkout' on the Admin Configuration page.
14+
Expands the 'Advanced Settings' tab.
15+
Expands the 'Frontend Experience Settings' tab.
16+
Expands the 'Features' tab.</description>
17+
</annotations>
18+
<arguments>
19+
<argument name="countryCode" type="string" defaultValue="us"/>
20+
</arguments>
21+
22+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
23+
<click selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="openAdvancedSettingTab"/>
24+
<click selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab(countryCode)}}" stepKey="openFrontendExperienceSettingsTab"/>
25+
<click selector="{{PayPalAdvancedSettingConfigSection.featuresTab(countryCode)}}" stepKey="openFeaturesTab"/>
26+
<seeElement selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect(countryCode)}}" stepKey="seeDisableFundingOptionsMultiselect"/>
27+
</actionGroup>
28+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminSelectDisableFundingActionGroup">
12+
<annotations>
13+
<description>Clicks on specified option in 'Disable Funding Options' list.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="countryCode" type="string" defaultValue="us"/>
17+
<argument name="option" type="string" defaultValue="Venmo"/>
18+
</arguments>
19+
20+
<selectOption selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect(countryCode)}}" userInput="{{option}}" stepKey="selectOption"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminUnselectDisableFundingActionGroup">
12+
<annotations>
13+
<description>Unselects specified option in 'Disable Funding Options' list.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="countryCode" type="string" defaultValue="us"/>
17+
<argument name="option" type="string" defaultValue="Venmo"/>
18+
</arguments>
19+
20+
<unselectOption selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect(countryCode)}}" userInput="{{option}}" stepKey="unselectOption"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="PayPalAdvancedFrontendExperienceFeaturesSection">
11+
<element name="disableFundingOptionsMultiselect" type="multiselect" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_frontend_features_disable_funding_options" parameterized="true"/>
12+
</section>
13+
</sections>

app/code/Magento/Paypal/Test/Mftf/Section/PayPalExpressCheckoutConfigSection/PayPalAdvancedSettingConfigSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="frontendExperienceSettingsTab" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_frontend-head" parameterized="true"/>
1313
<element name="checkoutPageTab" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_frontend_checkout_page_button-head" parameterized="true"/>
1414
<element name="displayonshoppingcart" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_visible_on_cart" parameterized="true"/>
15+
<element name="featuresTab" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_frontend_features-head" parameterized="true"/>
1516
</section>
1617
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="StorefrontPayPalSmartButtonVenmoSection">
11+
<element name="venmoButton" type="button" selector="//div[@data-funding-source='venmo']"/>
12+
</section>
13+
</sections>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminTurnOffVenmoButtonTest">
12+
<annotations>
13+
<features value="Paypal"/>
14+
<stories value="Payment methods configuration"/>
15+
<title value="Check that Admin can turn off Venmo button"/>
16+
<description value="Venmo button can be turned off by Admin"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-7121"/>
19+
<useCaseId value="ACP2E-1303"/>
20+
<group value="paypal"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
24+
</before>
25+
<after>
26+
<!-- Log out Admin -->
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
28+
</after>
29+
30+
<!-- Open PayPal Advanced->Frontend Experience->Features configuration -->
31+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage1"/>
32+
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeaturesPage1"/>
33+
<!-- Venmo option is present in Disable Funding Options multiselect -->
34+
<see selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmoOption"/>
35+
<!-- Select Venmo option in Disable Funding Options multiselect and save config -->
36+
<actionGroup ref="AdminSelectDisableFundingActionGroup" stepKey="selectVenmoOption"/>
37+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig1"/>
38+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
39+
<magentoCLI command="cache:clean config" stepKey="cleanCacheAfterOptionSelected"/>
40+
41+
<!-- Open PayPal Advanced->Frontend Experience->Features configuration page again -->
42+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage2"/>
43+
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey="openFeaturesPage2"/>
44+
<!-- Check Venmo option is selected -->
45+
<seeOptionIsSelected selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="Venmo" stepKey="seeVenmoIsSelected"/>
46+
<!-- Unselect Venmo option in Disable Funding Options multiselect and save config -->
47+
<actionGroup ref="AdminUnselectDisableFundingActionGroup" stepKey="unselectVenmoOption"/>
48+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig2"/>
49+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage2"/>
50+
<magentoCLI command="cache:clean config" stepKey="cleanCacheAfterOptionUnselected"/>
51+
52+
</test>
53+
</tests>

app/code/Magento/Paypal/Test/Unit/Model/SdkUrlTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private function getDisallowedFundingMap()
144144
{
145145
return [
146146
"CREDIT" => 'credit',
147+
"VENMO" => 'venmo',
147148
"CARD" => 'card',
148149
"ELV" => 'sepa'
149150
];

app/code/Magento/Paypal/Test/Unit/Model/_files/expected_url_config.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,41 @@ function generateExpectedPaypalSdkUrl(array $params) : String
214214
)
215215
]
216216
],
217+
'venmo_disabled' => [
218+
'en_US',
219+
'Authorization',
220+
'CREDIT,VENMO,ELV,CARD',
221+
false,
222+
true,
223+
[
224+
'sdkUrl' => generateExpectedPaypalSdkUrl(
225+
[
226+
'client-id' => 'sb',
227+
'locale' => 'en_US',
228+
'currency' => 'USD',
229+
'enable-funding' => implode(',', ['venmo', 'paylater']),
230+
'commit' => 'false',
231+
'intent' => 'authorize',
232+
'merchant-id' => 'merchant',
233+
'disable-funding' => implode(
234+
',',
235+
[
236+
'credit',
237+
'venmo',
238+
'sepa',
239+
'card',
240+
'bancontact',
241+
'eps',
242+
'giropay',
243+
'ideal',
244+
'mybank',
245+
'p24',
246+
'sofort'
247+
]
248+
),
249+
'components' => implode(',', ['messages', 'buttons']),
250+
]
251+
)
252+
]
253+
],
217254
];

app/code/Magento/Paypal/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
<arguments>
264264
<argument name="disallowedFundingOptions" xsi:type="array">
265265
<item name="CREDIT" xsi:type="string">PayPal Credit</item>
266+
<item name="VENMO" xsi:type="string">Venmo</item>
266267
<item name="CARD" xsi:type="string">PayPal Guest Checkout Credit Card Icons</item>
267268
<item name="ELV" xsi:type="string">Elektronisches Lastschriftverfahren - German ELV</item>
268269
</argument>

0 commit comments

Comments
 (0)