Skip to content

Commit dc339eb

Browse files
author
Joan He
committed
Merge remote-tracking branch 'trigger/MC-15139' into pr
2 parents 605ec6f + 51e59e0 commit dc339eb

9 files changed

+419
-37
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="OpenPayPalButtonCheckoutPage">
11-
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn}}" stepKey="clickPayPalConfigureBtn"/>
12-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="waitForAdvancedSettingTab"/>
13-
<click selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="openAdvancedSettingTab"/>
14-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab}}" stepKey="waitForFrontendExperienceSettingsTab"/>
15-
<click selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab}}" stepKey="openFrontendExperienceSettingsTab"/>
16-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab}}" stepKey="waitForCheckoutPageTab"/>
17-
<click selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab}}" stepKey="openCheckoutPageTab"/>
11+
<arguments>
12+
<argument name="countryCode" type="string" defaultValue="us"/>
13+
</arguments>
14+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
15+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
16+
<click selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="openAdvancedSettingTab"/>
17+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab(countryCode)}}" stepKey="waitForFrontendExperienceSettingsTab"/>
18+
<click selector="{{PayPalAdvancedSettingConfigSection.frontendExperienceSettingsTab(countryCode)}}" stepKey="openFrontendExperienceSettingsTab"/>
19+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab(countryCode)}}" stepKey="waitForCheckoutPageTab"/>
20+
<click selector="{{PayPalAdvancedSettingConfigSection.checkoutPageTab(countryCode)}}" stepKey="openCheckoutPageTab"/>
1821
</actionGroup>
1922
</actionGroups>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="EnablePayPalConfiguration">
11+
<arguments>
12+
<argument name="payPalConfigType"/>
13+
<argument name="countryCode" type="string" defaultValue="us"/>
14+
</arguments>
15+
<waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/>
16+
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
17+
<waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/>
18+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/>
19+
<waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/>
20+
<selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/>
21+
<seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/>
22+
<acceptPopup stepKey="acceptEnablePopUp"/>
23+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
24+
<waitForPageLoad stepKey="waitForPageLoad2"/>
25+
</actionGroup>
26+
<actionGroup name="CheckEnableOptionPayPalConfiguration">
27+
<arguments>
28+
<argument name="payPalConfigType"/>
29+
<argument name="enabledOption" type="string"/>
30+
<argument name="countryCode" type="string" defaultValue="us"/>
31+
</arguments>
32+
<waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/>
33+
<conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/>
34+
<waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/>
35+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/>
36+
<waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/>
37+
<seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/>
38+
<click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/>
39+
</actionGroup>
40+
</actionGroups>

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="ConfigPayPalExpressCheckout">
11+
<arguments>
12+
<argument name="credentials" defaultValue="_CREDS"/>
13+
<argument name="countryCode" type="string" defaultValue="us"/>
14+
</arguments>
1115
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
1216
<waitForPageLoad stepKey="waitForPageLoad1"/>
13-
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn}}" stepKey="clickPayPalConfigureBtn"/>
14-
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab}}" stepKey="waitForAdvancedSettingTab"/>
15-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email}}" userInput="{{_CREDS.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
16-
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
17-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username}}" userInput="{{_CREDS.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
18-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password}}" userInput="{{_CREDS.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
19-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature}}" userInput="{{_CREDS.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
20-
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode}}" userInput="Yes" stepKey="enableSandboxMode"/>
21-
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution}}" userInput="Yes" stepKey="enableSolution"/>
22-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID}}" userInput="{{_CREDS.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
17+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
18+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
19+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
20+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
21+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
22+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
23+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
24+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
25+
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
26+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
2327
<!--Save configuration-->
2428
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
2529
</actionGroup>

app/code/Magento/Paypal/Test/Mftf/Data/PaypalData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
<entity name="SampleUseProxy" type="use_proxy">
3939
<data key="value">0</data>
4040
</entity>
41+
<entity name="SampleMerchantID" type="use_proxy">
42+
<data key="value">someMerchantId</data>
43+
</entity>
4144

4245
<!-- default configuration used to restore Magento config -->
4346
<entity name="DefaultPayPalConfig" type="paypal_config_state">
@@ -89,4 +92,11 @@
8992
<data key="silver">silver</data>
9093
<data key="black">black</data>
9194
</entity>
95+
<entity name="SamplePaypalExpressConfig" type="paypal_express_config">
96+
<data key="paypal_express_email">myBusinessAccount@magento.com</data>
97+
<data key="paypal_express_api_username">myApiUsername.magento.com</data>
98+
<data key="paypal_express_api_password">somePassword</data>
99+
<data key="paypal_express_api_signature">someApiSignature</data>
100+
<data key="paypal_express_merchantID">someMerchantId</data>
101+
</entity>
92102
</entities>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="OtherPayPalPaymentsConfigSection">
12+
<element name="expandTab" type="button" selector="#payment_{{countryCode}}_other_paypal_payment_solutions-head" parameterized="true"/>
13+
<element name="expandedTab" type="button" selector="#payment_{{countryCode}}_other_paypal_payment_solutions-head.open" parameterized="true"/>
14+
</section>
15+
<section name="WPSExpressConfigSection">
16+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express-head" parameterized="true"/>
17+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_enable_express_checkout" parameterized="true"/>
18+
</section>
19+
<section name="PaymentsProHostedWithExpressCheckoutConfigSection">
20+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout-head" parameterized="true"/>
21+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout_pphs_required_settings_pphs_enable" parameterized="true"/>
22+
</section>
23+
<section name="WPSOtherConfigSection">
24+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_other-head" parameterized="true"/>
25+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_other_express_checkout_required_enable_express_checkout" parameterized="true"/>
26+
</section>
27+
<section name="WebsitePaymentsPlusConfigSection">
28+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payments_pro_hosted_solution_{{countryCode}}-head" parameterized="true"/>
29+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payments_pro_hosted_solution_{{countryCode}}_pphs_required_settings_pphs_enable" parameterized="true"/>
30+
</section>
31+
</sections>

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="PayPalExpressCheckoutConfigSection">
12-
<element name="configureBtn" type="button" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us-head"/>
13-
<element name="email" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_business_account" />
14-
<element name="apiMethod" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_authentication"/>
15-
<element name="username" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_username"/>
16-
<element name="password" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_password"/>
17-
<element name="signature" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_signature"/>
18-
<element name="sandboxMode" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_sandbox_flag"/>
19-
<element name="enableSolution" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_enable_express_checkout"/>
20-
<element name="merchantID" type="input" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_merchant_id"/>
12+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}-head" parameterized="true"/>
13+
<element name="email" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_business_account" parameterized="true"/>
14+
<element name="apiMethod" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_api_authentication" parameterized="true"/>
15+
<element name="username" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_api_username" parameterized="true"/>
16+
<element name="password" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_api_password" parameterized="true"/>
17+
<element name="signature" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_api_signature" parameterized="true"/>
18+
<element name="sandboxMode" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_express_checkout_required_express_checkout_sandbox_flag" parameterized="true"/>
19+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_enable_express_checkout" parameterized="true"/>
20+
<element name="merchantID" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_merchant_id" parameterized="true"/>
21+
</section>
22+
<section name="PayPalExpressCheckoutOtherCountryConfigSection">
23+
<element name="configureBtn" type="button" selector="#payment_{{countryCode}}_express_checkout_other-head" parameterized="true"/>
24+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_express_checkout_other_express_checkout_required_enable_express_checkout" parameterized="true"/>
2125
</section>
2226
<section name="PayPalAdvancedSettingConfigSection">
23-
<element name="advancedSettingTab" type="button" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_settings_ec_settings_ec_advanced-head"/>
24-
<element name="frontendExperienceSettingsTab" type="button" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_settings_ec_settings_ec_advanced_express_checkout_frontend-head"/>
25-
<element name="checkoutPageTab" type="button" selector="#payment_us_paypal_alternative_payment_methods_express_checkout_us_settings_ec_settings_ec_advanced_express_checkout_frontend_checkout_page_button-head"/>
27+
<element name="advancedSettingTab" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced-head" parameterized="true"/>
28+
<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"/>
29+
<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"/>
2630
</section>
2731
<section name="ButtonCustomization">
2832
<element name="customizeDrpDown" type="button" selector="//tr[@id='row_payment_us_paypal_alternative_payment_methods_express_checkout_us_settings_ec_settings_ec_advanced_express_checkout_frontend_checkout_page_button_checkout_page_button_customize']//select[contains(@data-ui-id, 'button-customize')]"/>
Lines changed: 14 additions & 0 deletions
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="PaymentsConfigSection">
12+
<element name="merchantCountry" type="select" selector="//select[@name='groups[account][fields][merchant_country][value]']"/>
13+
</section>
14+
</sections>

0 commit comments

Comments
 (0)