Skip to content

Commit 83369f7

Browse files
committed
MQE-1686: Paypal integration test leveraging Adobe Vault - PayPalSmartButtonInCheckoutPage
1 parent cea3e79 commit 83369f7

7 files changed

+201
-140
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="VerifyCheckoutSuccessActionGroup">
12+
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
13+
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/>
14+
<seeElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="seeOrderLink"/>
15+
</actionGroup>
16+
</actionGroups>
17+
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+
<!-- Action group to delete an item given that items name -->
12+
<!-- Must already be on the admin page containing the grid -->
13+
<actionGroup name="OpenCartOnPayPalActionGroup">
14+
<click selector="{{PayPalPaymentSection.cartIcon}}" stepKey="openCart"/>
15+
<seeElement selector="{{PayPalPaymentSection.itemName($$createProduct.name$$)}}" stepKey="seeProductname"/>
16+
<click selector="{{PayPalPaymentSection.PayPalSubmitBtn}}" stepKey="clickPayPalSubmitBtn"/>
17+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
18+
<waitForPageLoad stepKey="waitForPageLoad"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,40 @@
1616
<waitForPageLoad stepKey="waitForPageLoad1"/>
1717
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
1818
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
19-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
19+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{_CREDS.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
2020
<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"/>
21+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{_CREDS.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/>
22+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{_CREDS.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/>
23+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{_CREDS.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/>
2424
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
2525
<selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
26-
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/>
26+
<fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{_CREDS.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/>
2727
<!--Save configuration-->
2828
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
2929
</actionGroup>
3030
<actionGroup name="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup">
31+
<arguments>
32+
<argument name="payerName" defaultValue="MPI" type="string"/>
33+
</arguments>
3134
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/>
3235
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/>
3336
<!--set ID for iframe of PayPal group button-->
3437
<executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/>
3538
<!--switch to iframe of PayPal group button-->
36-
<comment userInput="switch to iframe of PayPal group button" stepKey="commentSwitchToIframe"/>
3739
<switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/>
3840
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
3941
<click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/>
4042
<switchToIFrame stepKey="switchBack1"/>
4143
<!--Check in-context-->
42-
<comment userInput="Check in-context" stepKey="commentVerifyInContext"/>
4344
<switchToNextTab stepKey="switchToInContentTab"/>
4445
<waitForPageLoad stepKey="waitForPageLoad"/>
4546
<seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/>
4647
<waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" />
47-
<fillField selector="{{PayPalPaymentSection.email}}" userInput="{{Payer.buyerEmail}}" stepKey="fillEmail"/>
48-
<fillField selector="{{PayPalPaymentSection.password}}" userInput="{{Payer.buyerPassword}}" stepKey="fillPassword"/>
48+
<fillField selector="{{PayPalPaymentSection.email}}" userInput="{{_CREDS.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/>
49+
<fillField selector="{{PayPalPaymentSection.password}}" userInput="{{_CREDS.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/>
4950
<click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/>
5051
<waitForPageLoad stepKey="wait"/>
51-
<seeElement selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/>
52+
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/>
5253
</actionGroup>
5354
<actionGroup name="addProductToCheckoutPage">
5455
<arguments>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<element name="email" type="input" selector="//input[contains(@name, 'email') and not(contains(@style, 'display:none'))]"/>
5555
<element name="password" type="input" selector="//input[contains(@name, 'password') and not(contains(@style, 'display:none'))]"/>
5656
<element name="loginBtn" type="input" selector="button#btnLogin"/>
57-
<element name="reviewUserInfo" type="text" selector="//p[@id='reviewUserInfo' and contains(text(),'Hi, MPI!')]"/>
57+
<element name="reviewUserInfo" type="text" selector="//p[@id='reviewUserInfo']"/>
5858
<element name="cartIcon" type="text" selector="#transactionCart"/>
5959
<element name="itemName" type="text" selector="//span[@title='{{productName}}']" parameterized="true"/>
6060
<element name="PayPalSubmitBtn" type="text" selector="//input[@type='submit']"/>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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="CheckCreditButtonConfiguration">
12+
<annotations>
13+
<features value="PayPal"/>
14+
<stories value="Button Configuration"/>
15+
<title value="Check Credit Button Configuration"/>
16+
<description value="Admin is able to customize Credit button"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-10900"/>
19+
<skip>
20+
<issueId value="DEVOPS-3311"/>
21+
</skip>
22+
</annotations>
23+
<before>
24+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createPreReqProduct">
26+
<requiredEntity createDataKey="createPreReqCategory"/>
27+
</createData>
28+
<!-- Create Customer -->
29+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
30+
<actionGroup ref="LoginActionGroup" stepKey="login"/>
31+
<!--Config PayPal Express Checkout-->
32+
<comment userInput="config PayPal Express Checkout" stepKey="commemtConfigPayPalExpressCheckout"/>
33+
<actionGroup ref="ConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpressCheckout"/>
34+
</before>
35+
<after>
36+
<deleteData stepKey="deleteCategory" createDataKey="createPreReqCategory"/>
37+
<deleteData stepKey="deleteProduct" createDataKey="createPreReqProduct"/>
38+
<deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/>
39+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
40+
</after>
41+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
42+
<waitForPageLoad stepKey="waitForPageLoad1"/>
43+
<!--Navigate to button configuration setting-->
44+
<comment userInput="Navigate to button configuration setting in Admin site" stepKey="commentNavigateToButtonConfigurationInAdmin"/>
45+
<actionGroup ref="OpenPayPalButtonCheckoutPage" stepKey="openPayPalButtonCheckoutPage"/>
46+
<waitForElement selector="{{ButtonCustomization.customizeDrpDown}}" stepKey="seeCustomizeDropDown"/>
47+
<selectOption selector="{{ButtonCustomization.customizeDrpDown}}" userInput="Yes" stepKey="enableButtonCustomization"/>
48+
<!--Verify Credit Button value-->
49+
<comment userInput="Verify Credit Button value" stepKey="commentVerifyDefaultValue2"/>
50+
<selectOption selector="{{ButtonCustomization.label}}" userInput="{{PayPalLabel.credit}}" stepKey="selectCreditAsLabel"/>
51+
<seeElement selector="{{ButtonCustomization.size}}" stepKey="seeSize2"/>
52+
<seeElement selector="{{ButtonCustomization.shape}}" stepKey="seeShape2"/>
53+
<dontSeeElement selector="{{ButtonCustomization.layout}}" stepKey="dontSeeLayout"/>
54+
<dontSeeElement selector="{{ButtonCustomization.color}}" stepKey="dontSeeColor"/>
55+
<!--Customize Credit Button-->
56+
<selectOption selector="{{ButtonCustomization.size}}" userInput="{{PayPalSize.medium}}" stepKey="selectSize"/>
57+
<selectOption selector="{{ButtonCustomization.shape}}" userInput="{{PayPalShape.pill}}" stepKey="selectShape"/>
58+
<!--Save configuration-->
59+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
60+
<waitForPageLoad stepKey="waitForConfigSave"/>
61+
<openNewTab stepKey="openNewTab"/>
62+
<amOnPage url="/" stepKey="openStorefront"/>
63+
<!--Login to storefront as previously created customer-->
64+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
65+
<argument name="Customer" value="$$createCustomer$$"/>
66+
</actionGroup>
67+
<actionGroup ref="addProductToCheckoutPage" stepKey="addProductToCheckoutPage">
68+
<argument name="Category" value="$$createPreReqCategory$$"/>
69+
</actionGroup>
70+
<!--set ID for iframe of PayPal group button-->
71+
<executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/>
72+
<!--switch to iframe of PayPal group button-->
73+
<comment userInput="switch to iframe of PayPal group button" stepKey="commentSwitchToIframe"/>
74+
<switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/>
75+
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
76+
<seeElement selector="{{PayPalButtonOnStorefront.label(PayPalLabel.credit)}}{{PayPalButtonOnStorefront.size(PayPalSize.medium)}}" stepKey="seeButtonInMediumSize"/>
77+
<seeElement selector="{{PayPalButtonOnStorefront.label(PayPalLabel.credit)}}{{PayPalButtonOnStorefront.shape(PayPalShape.pill)}}" stepKey="seeButtonInPillShape"/>
78+
</test>
79+
</tests>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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="CheckDefaultValueOfPayPalCustomizeButtonTest">
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+
<skip>
20+
<issueId value="DEVOPS-3311"/>
21+
</skip>
22+
</annotations>
23+
<before>
24+
<actionGroup ref="LoginActionGroup" stepKey="login"/>
25+
<actionGroup ref="ConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpressCheckout"/>
26+
</before>
27+
<after>
28+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
29+
</after>
30+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
31+
<waitForPageLoad stepKey="waitForPageLoad1"/>
32+
<actionGroup ref="OpenPayPalButtonCheckoutPage" stepKey= "openPayPalButtonCheckoutPage"/>
33+
<seeElement selector="{{ButtonCustomization.customizeDrpDown}}" stepKey="seeCustomizeDropDown"/>
34+
<seeOptionIsSelected selector="{{ButtonCustomization.customizeDrpDown}}" userInput="No" stepKey="seeNoIsDefaultValue"/>
35+
<selectOption selector="{{ButtonCustomization.customizeDrpDown}}" userInput="Yes" stepKey="enableButtonCustomization"/>
36+
<!--Verify default value-->
37+
<comment userInput="Verify default value" stepKey="commentVerifyDefaultValue1"/>
38+
<seeElement selector="{{ButtonCustomization.label}}" stepKey="seeLabel"/>
39+
<seeElement selector="{{ButtonCustomization.layout}}" stepKey="seeLayout"/>
40+
<seeElement selector="{{ButtonCustomization.size}}" stepKey="seeSize1"/>
41+
<seeElement selector="{{ButtonCustomization.shape}}" stepKey="seeShape1"/>
42+
<seeElement selector="{{ButtonCustomization.color}}" stepKey="seeColor"/>
43+
</test>
44+
</tests>

0 commit comments

Comments
 (0)