Skip to content

Commit eefcf4f

Browse files
Merge remote-tracking branch 'remotes/github/2.3-develop' into MC-18709
2 parents d25efa8 + d69f3e8 commit eefcf4f

13 files changed

+381
-204
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AssertStorefrontCheckoutSuccessActionGroup">
12+
<annotations>
13+
<description>Verifies if the order is placed successfully on the 'one page checkout' page.</description>
14+
</annotations>
15+
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
16+
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/>
17+
<seeElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="seeOrderLink"/>
18+
</actionGroup>
19+
</actionGroups>
20+

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

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,31 @@
1616
<argument name="credentials" defaultValue="_CREDS"/>
1717
<argument name="countryCode" type="string" defaultValue="us"/>
1818
</arguments>
19-
19+
20+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
21+
<waitForPageLoad stepKey="waitForPageLoad1"/>
22+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
23+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
24+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
25+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
26+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/>
27+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/>
28+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/>
29+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
30+
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
31+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/>
32+
<!--Save configuration-->
33+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
34+
</actionGroup>
35+
36+
<actionGroup name="SampleConfigPayPalExpressCheckout">
37+
<annotations>
38+
<description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description>
39+
</annotations>
40+
<arguments>
41+
<argument name="credentials" defaultValue="SamplePaypalExpressConfig"/>
42+
<argument name="countryCode" type="string" defaultValue="us"/>
43+
</arguments>
2044
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
2145
<waitForPageLoad stepKey="waitForPageLoad1"/>
2246
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
@@ -29,50 +53,52 @@
2953
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
3054
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
3155
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
32-
3356
<!--Save configuration-->
3457
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
3558
</actionGroup>
36-
59+
3760
<actionGroup name="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup">
3861
<annotations>
3962
<description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on PayPal. Fills the PayPay details in the modal. PLEASE NOTE: The PayPal Payment credentials are Hardcoded using 'Payer'.</description>
4063
</annotations>
41-
64+
<arguments>
65+
<argument name="payerName" defaultValue="MPI" type="string"/>
66+
<argument name="credentials" defaultValue="_CREDS"/>
67+
</arguments>
68+
69+
<!-- click on PayPal payment radio button -->
4270
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/>
4371
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/>
44-
72+
4573
<!--set ID for iframe of PayPal group button-->
4674
<executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/>
47-
75+
4876
<!--switch to iframe of PayPal group button-->
49-
<comment userInput="switch to iframe of PayPal group button" stepKey="commentSwitchToIframe"/>
5077
<switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/>
5178
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
5279
<click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/>
5380
<switchToIFrame stepKey="switchBack1"/>
54-
81+
5582
<!--Check in-context-->
56-
<comment userInput="Check in-context" stepKey="commentVerifyInContext"/>
5783
<switchToNextTab stepKey="switchToInContentTab"/>
5884
<waitForPageLoad stepKey="waitForPageLoad"/>
5985
<seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/>
60-
<waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm"/>
61-
<fillField selector="{{PayPalPaymentSection.email}}" userInput="{{Payer.buyerEmail}}" stepKey="fillEmail"/>
62-
<fillField selector="{{PayPalPaymentSection.password}}" userInput="{{Payer.buyerPassword}}" stepKey="fillPassword"/>
86+
<waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" />
87+
<fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/>
88+
<fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/>
6389
<click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/>
6490
<waitForPageLoad stepKey="wait"/>
65-
<seeElement selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/>
91+
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/>
6692
</actionGroup>
67-
93+
6894
<actionGroup name="addProductToCheckoutPage">
6995
<annotations>
7096
<description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description>
7197
</annotations>
7298
<arguments>
7399
<argument name="Category"/>
74100
</arguments>
75-
101+
76102
<amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/>
77103
<waitForPageLoad stepKey="waitForPageLoad1"/>
78104
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontPayOrderOnPayPalCheckoutActionGroup">
12+
<annotations>
13+
<description>Verifies product name on Paypal cart and clicks 'Pay Now' on PayPal payment checkout page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
</arguments>
18+
<click selector="{{PayPalPaymentSection.cartIcon}}" stepKey="openCart"/>
19+
<seeElement selector="{{PayPalPaymentSection.itemName(productName)}}" stepKey="seeProductName"/>
20+
<click selector="{{PayPalPaymentSection.PayPalSubmitBtn}}" stepKey="clickPayPalSubmitBtn"/>
21+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="StorefrontPaypalEnableConfigData">
12+
<data key="path">payment/paypal_express/active</data>
13+
<data key="scope_id">1</data>
14+
<data key="label">Yes</data>
15+
<data key="value">1</data>
16+
</entity>
17+
<entity name="StorefrontPaypalDisableConfigData">
18+
<data key="path">payment/paypal_express/active</data>
19+
<data key="scope_id">1</data>
20+
<data key="label">No</data>
21+
<data key="value">0</data>
22+
</entity>
23+
<entity name="StorefrontPaypalMerchantAccountIdConfigData">
24+
<data key="path">payment/paypal_express/merchant_id</data>
25+
<data key="scope_id">1</data>
26+
<data key="value">''</data>
27+
</entity>
28+
<entity name="StorefrontPaypalEnableSkipOrderReviewStepConfigData">
29+
<data key="path">payment/paypal_express/skip_order_review_step</data>
30+
<data key="scope_id">1</data>
31+
<data key="label">Yes</data>
32+
<data key="value">1</data>
33+
</entity>
34+
<entity name="StorefrontPaypalDisableSkipOrderReviewStepConfigData">
35+
<data key="path">payment/paypal_express/skip_order_review_step</data>
36+
<data key="scope_id">1</data>
37+
<data key="label">No</data>
38+
<data key="value">0</data>
39+
</entity>
40+
<entity name="StorefrontPaypalEnableInContextCheckoutConfigData">
41+
<data key="path">payment/paypal_express/in_context</data>
42+
<data key="scope_id">1</data>
43+
<data key="label">Yes</data>
44+
<data key="value">1</data>
45+
</entity>
46+
<entity name="StorefrontPaypalDisableInContextCheckoutConfigData">
47+
<data key="path">payment/paypal_express/active</data>
48+
<data key="scope_id">1</data>
49+
<data key="label">No</data>
50+
<data key="value">0</data>
51+
</entity>
52+
</entities>

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,37 @@
9999
<data key="paypal_express_api_signature">someApiSignature</data>
100100
<data key="paypal_express_merchantID">someMerchantId</data>
101101
</entity>
102+
<entity name="PaypalConfig" type="paypal_config_state">
103+
<requiredEntity type="business_account">BusinessAccount</requiredEntity>
104+
<requiredEntity type="api_username">ApiUsername</requiredEntity>
105+
<requiredEntity type="api_password">ApiPassword</requiredEntity>
106+
<requiredEntity type="api_signature">ApiSignature</requiredEntity>
107+
<requiredEntity type="api_authentication">ApiAuthentication</requiredEntity>
108+
<requiredEntity type="sandbox_flag">SandboxFlag</requiredEntity>
109+
<requiredEntity type="use_proxy">UseProxy</requiredEntity>
110+
</entity>
111+
<entity name="BusinessAccount" type="business_account">
112+
<data key="value">{{_CREDS.magento/paypal_express_checkout_us_business_account}}</data>
113+
</entity>
114+
<entity name="ApiUsername" type="api_username">
115+
<data key="value">{{_CREDS.magento/paypal_express_checkout_us_api_username}}</data>
116+
</entity>
117+
<entity name="ApiPassword" type="api_password">
118+
<data key="value">{{_CREDS.magento/paypal_express_checkout_us_api_password}}</data>
119+
</entity>
120+
<entity name="ApiSignature" type="api_signature">
121+
<data key="value">{{_CREDS.magento/paypal_express_checkout_us_api_signature}}</data>
122+
</entity>
123+
<entity name="ApiAuthentication" type="api_authentication">
124+
<data key="value">0</data>
125+
</entity>
126+
<entity name="SandboxFlag" type="sandbox_flag">
127+
<data key="value">1</data>
128+
</entity>
129+
<entity name="UseProxy" type="use_proxy">
130+
<data key="value">0</data>
131+
</entity>
132+
<entity name="Payer">
133+
<data key="firstName">Alex</data>
134+
</entity>
102135
</entities>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<element name="email" type="input" selector="//input[contains(@name, 'email') and not(contains(@style, 'display:none'))]"/>
5858
<element name="password" type="input" selector="//input[contains(@name, 'password') and not(contains(@style, 'display:none'))]"/>
5959
<element name="loginBtn" type="input" selector="button#btnLogin"/>
60-
<element name="reviewUserInfo" type="text" selector="//p[@id='reviewUserInfo' and contains(text(),'Hi, MPI!')]"/>
60+
<element name="reviewUserInfo" type="text" selector="#reviewUserInfo"/>
6161
<element name="cartIcon" type="text" selector="#transactionCart"/>
6262
<element name="itemName" type="text" selector="//span[@title='{{productName}}']" parameterized="true"/>
6363
<element name="PayPalSubmitBtn" type="text" selector="//input[@type='submit']"/>

app/code/Magento/Paypal/Test/Mftf/Suite/suite.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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="AdminCheckDefaultValueOfPayPalCustomizeButtonTest">
12+
<annotations>
13+
<features value="Paypal"/>
14+
<stories value="Button Configuration"/>
15+
<title value="Check Default Value Of Paypal Customize Button"/>
16+
<description value="Default value of Paypal Customize Button should be NO"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-10904"/>
19+
<group value="paypal"/>
20+
<skip>
21+
<issueId value="DEVOPS-3311"/>
22+
</skip>
23+
</annotations>
24+
<before>
25+
<actionGroup ref="LoginActionGroup" stepKey="login"/>
26+
<actionGroup ref="ConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpressCheckout"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
30+
</after>
31+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
32+
<waitForPageLoad stepKey="waitForPageLoad1"/>
33+
<actionGroup ref="OpenPayPalButtonCheckoutPage" stepKey= "openPayPalButtonCheckoutPage"/>
34+
<seeElement selector="{{ButtonCustomization.customizeDrpDown}}" stepKey="seeCustomizeDropDown"/>
35+
<seeOptionIsSelected selector="{{ButtonCustomization.customizeDrpDown}}" userInput="No" stepKey="seeNoIsDefaultValue"/>
36+
<selectOption selector="{{ButtonCustomization.customizeDrpDown}}" userInput="Yes" stepKey="enableButtonCustomization"/>
37+
<!--Verify default value-->
38+
<comment userInput="Verify default value" stepKey="commentVerifyDefaultValue1"/>
39+
<seeElement selector="{{ButtonCustomization.label}}" stepKey="seeLabel"/>
40+
<seeElement selector="{{ButtonCustomization.layout}}" stepKey="seeLayout"/>
41+
<seeElement selector="{{ButtonCustomization.size}}" stepKey="seeSize1"/>
42+
<seeElement selector="{{ButtonCustomization.shape}}" stepKey="seeShape1"/>
43+
<seeElement selector="{{ButtonCustomization.color}}" stepKey="seeColor"/>
44+
</test>
45+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</annotations>
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23-
<actionGroup ref="ConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpress">
23+
<actionGroup ref="SampleConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpress">
2424
<argument name="credentials" value="SamplePaypalExpressConfig"/>
2525
</actionGroup>
2626
</before>

0 commit comments

Comments
 (0)