Skip to content

Commit 001bf71

Browse files
committed
ACP2E-1303: Pay later payments showing on the storefront even disabled
1 parent 314c59b commit 001bf71

7 files changed

+181
-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,14 @@
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+
<element name="disableFundingOptionsOption" type="multiselect" selector="//*[@value='{{option}}']" parameterized="true"/>
13+
</section>
14+
</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: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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="Button 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="ACP2E-1303"/>
19+
<group value="paypal"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
23+
24+
<!-- Create Product -->
25+
<createData entity="_defaultCategory" stepKey="createCategory"/>
26+
<createData entity="_defaultProduct" stepKey="createProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
31+
</before>
32+
<after>
33+
34+
<!-- Cleanup Paypal configurations -->
35+
36+
<!-- Delete Product -->
37+
<deleteData stepKey="deleteCategory" createDataKey="createCategory"/>
38+
<deleteData stepKey="deleteProduct" createDataKey="createProduct"/>
39+
40+
<!-- Log out Admin -->
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
42+
</after>
43+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage1"/>
44+
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeaturesPage1"/>
45+
<actionGroup ref="AdminSelectDisableFundingActionGroup" stepKey= "selectVenmo"/>
46+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig1"/>
47+
<magentoCLI command="cache:flush" stepKey="cleanCache1"/>
48+
49+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage1">
50+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
51+
</actionGroup>
52+
53+
<actionGroup ref="StorefrontSwitchToPayPalButtonIframeActionGroup" stepKey="switchToIframe1"/>
54+
55+
<dontSeeElement selector="{{StorefrontPayPalSmartButtonVenmoSection.venmoButton}}" stepKey="dontSeeVenmoButton"/>
56+
57+
58+
59+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage2"/>
60+
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeaturesPage2"/>
61+
<actionGroup ref="AdminUnselectDisableFundingActionGroup" stepKey= "unselectVenmo"/>
62+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig2"/>
63+
<magentoCLI command="cache:flush" stepKey="cleanCache2"/>
64+
65+
66+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage2">
67+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
68+
</actionGroup>
69+
70+
<actionGroup ref="StorefrontSwitchToPayPalButtonIframeActionGroup" stepKey="switchToIframe2"/>
71+
72+
<seeElement selector="{{StorefrontPayPalSmartButtonVenmoSection.venmoButton}}" stepKey="seeVenmoButton"/>
73+
74+
75+
<!-- <seeOptionIsSelected selector="{{ButtonCustomization.customizeDrpDown}}" userInput="No" stepKey="seeNoIsDefaultValue"/>
76+
<selectOption selector="{{ButtonCustomization.customizeDrpDown}}" userInput="Yes" stepKey="enableButtonCustomization"/>
77+
<pause stepKey="pause"/>
78+
79+
-->
80+
</test>
81+
</tests>

0 commit comments

Comments
 (0)