Skip to content

Commit bccf85f

Browse files
committed
ACQE-6496:Configuration for paypal pay later on Category Page
1 parent 995a05c commit bccf85f

7 files changed

+252
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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="AdminPayPalStandardDisableActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="credentials" defaultValue="SamplePaypalExpressConfig2"/>
17+
<argument name="countryCode" type="string" defaultValue="us"/>
18+
</arguments>
19+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
20+
<waitForPageLoad stepKey="waitForPageLoad8"/>
21+
<scrollTo selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" x="0" y="-80" stepKey="scrollToConfigure"/>
22+
<waitForElementClickable selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalStandardConfigureBtn" />
23+
<click selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalStandardConfigureBtn"/>
24+
<selectOption selector="{{PayPalStandardConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="disableSolution"/>
25+
<selectOption selector="{{PayPalStandardConfigSection.enablePaylaterExperience(countryCode)}}" userInput="Yes" stepKey="EnablePaylaterExperience"/>
26+
<waitForPageLoad stepKey="waitForadvisepaylaterdropdown"/>
27+
<waitForElementClickable selector="{{PayPalStandardConfigSection.advisepaylater(countryCode)}}" stepKey="waitForAdvisepaylaterClickable"/>
28+
<click selector="{{PayPalStandardConfigSection.advisepaylater(countryCode)}}" stepKey="clickAdvisePaylater"/>
29+
<selectOption selector="{{PayPalStandardConfigSection.enablePaypalPaylater(countryCode)}}" userInput="Yes" stepKey="EnablePaypallater"/>
30+
<waitForElementClickable selector="{{PayPalStandardConfigSection.expandcategorypage(countryCode)}}" stepKey="waitForcategorypageClickable"/>
31+
<click selector="{{PayPalStandardConfigSection.expandcategorypage(countryCode)}}" stepKey="clickCategoryPage"/>
32+
<selectOption selector ="{{PayPalStandardConfigSection.display(countryCode)}}" userInput="Yes" stepKey="enableDisplayforPaylaterCategoryPage"/>
33+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.position(countryCode)}}" userInput="Header (center)" stepKey="seeSelectedPosition"/>
34+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.stylelayout(countryCode)}}" userInput="Flex" stepKey="seeSelectedStylelayout"/>
35+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.Ratio(countryCode)}}" userInput="20x1" stepKey="seeSelectedRatio"/>
36+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.color(countryCode)}}" userInput="Blue" stepKey="seeSelectedColor"/>
37+
<waitForElementClickable selector="{{AdminConfigSection.saveButton}}" stepKey="waitForConfiguBtn" />
38+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfiguration"/>
39+
<waitForPageLoad stepKey="waitForPageLoad82"/>
40+
</actionGroup>
41+
</actionGroups>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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="AdminPayPalStandardEnableActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="credentials" defaultValue="SamplePaypalExpressConfig2"/>
17+
<argument name="countryCode" type="string" defaultValue="us"/>
18+
</arguments>
19+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
20+
<waitForPageLoad stepKey="waitForPageLoad1"/>
21+
<waitForElementClickable selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForExpandOtherPaypalConfigButton" />
22+
<click selector ="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="expandOtherPaypalConfigButton"/>
23+
<scrollTo selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" x="0" y="-80" stepKey="scrollToConfigure"/>
24+
<waitForElementClickable selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalStandardConfigureBtn" />
25+
<click selector="{{PayPalStandardConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalStandardConfigureBtn"/>
26+
<waitForElementVisible selector="{{PayPalStandardConfigSection.email(countryCode)}}" stepKey="waitForEmailTab"/>
27+
<fillField selector ="{{PayPalStandardConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/>
28+
<selectOption selector ="{{PayPalStandardConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/>
29+
<fillField selector ="{{PayPalStandardConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/>
30+
<fillField selector ="{{PayPalStandardConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/>
31+
<fillField selector ="{{PayPalStandardConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/>
32+
<selectOption selector ="{{PayPalStandardConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/>
33+
<selectOption selector="{{PayPalStandardConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/>
34+
<waitForElementClickable selector="{{AdminConfigSection.saveButton}}" stepKey="waitForConfigureBtn" />
35+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
36+
<waitForPageLoad stepKey="waitForPageLoad2"/>
37+
</actionGroup>
38+
</actionGroups>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
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="EnablePaypalPaylaterConfigurationActionGroup" >
11+
<annotations>
12+
<description>Enable Paypal Paylater Solution For Paypal Express Checkout</description>
13+
</annotations>
14+
<click selector="{{PayPalStandardConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtn"/>
15+
<selectOption selector="{{PayPalStandardConfigSection.enablePaylaterExperience('us')}}" userInput="Yes" stepKey="EnablePaylaterExperience"/>
16+
<waitForPageLoad stepKey="waitForadvisepaylaterdropdown"/>
17+
<waitForElementClickable selector="{{PayPalStandardConfigSection.advisepaylater('us')}}" stepKey="waitForAdvisepaylaterClickable"/>
18+
<click selector="{{PayPalStandardConfigSection.advisepaylater('us')}}" stepKey="clickAdvisePaylater"/>
19+
<selectOption selector="{{PayPalStandardConfigSection.enablePaypalPaylater('us')}}" userInput="Yes" stepKey="EnablePaypallater"/>
20+
<waitForElementClickable selector="{{PayPalStandardConfigSection.expandcategorypage('us')}}" stepKey="waitForcategorypageClickable"/>
21+
<click selector="{{PayPalStandardConfigSection.expandcategorypage('us')}}" stepKey="clickCategoryPage"/>
22+
<selectOption selector ="{{PayPalStandardConfigSection.display('us')}}" userInput="Yes" stepKey="enableDisplayforPaylaterCategory"/>
23+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.position('us')}}" userInput="Header (center)" stepKey="seeSelectedPosition"/>
24+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.stylelayout('us')}}" userInput="Flex" stepKey="seeSelectedStylelayout"/>
25+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.Ratio('us')}}" userInput="20x1" stepKey="seeSelectedRatio"/>
26+
<seeOptionIsSelected selector="{{PayPalStandardConfigSection.color('us')}}" userInput="Blue" stepKey="seeSelectedColor"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@
196196
<entity name="DisablePaypalPayflowProVault" type="payflowpro_cc_vault_active">
197197
<data key="value">0</data>
198198
</entity>
199+
<entity name="EnablePaypalPayStandard">
200+
<data key="path">payment/wps_express/active</data>
201+
<data key="value">1</data>
202+
</entity>
203+
<entity name="DisablePaypalPayStandard">
204+
<data key="path">payment/wps_express/active</data>
205+
<data key="value">0</data>
206+
</entity>
199207
<entity name="Visa3DSecureCard" type="data">
200208
<data key="cardNumber">4000000000000002</data>
201209
<data key="month">12</data>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="PayPalStandardConfigSection">
11+
<element name="configureBtn" type="button" selector="//button[@id='payment_{{countryCode}}_paypal_group_all_in_one_wps_express-head']" parameterized="true"/>
12+
<element name="email" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_business_account" parameterized="true"/>
13+
<element name="apiMethod" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_authentication" parameterized="true"/>
14+
<element name="username" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_username" parameterized="true"/>
15+
<element name="password" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_password" parameterized="true"/>
16+
<element name="signature" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_api_signature" parameterized="true"/>
17+
<element name="sandboxMode" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_express_checkout_required_express_checkout_sandbox_flag" parameterized="true"/>
18+
<element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_enable_express_checkout" parameterized="true"/>
19+
<element name="enablePaylaterExperience" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_enable_paypal_paylater_experience" parameterized="true"/>
20+
<element name="expandcategorypage" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage-head" parameterized="true"/>
21+
<element name="advisepaylater" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater-head" parameterized="true"/>
22+
<element name="enablePaypalPaylater" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_paylater_enabled" parameterized="true"/>
23+
<element name="display" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage_paylater_categorypage_display" parameterized="true"/>
24+
<element name="position" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage_paylater_categorypage_position" parameterized="true"/>
25+
<element name="stylelayout" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage_paylater_categorypage_stylelayout" parameterized="true"/>
26+
<element name="Ratio" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage_paylater_categorypage_ratio" parameterized="true"/>
27+
<element name="color" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express_express_checkout_required_advertise_paylater_settings_paylater_categorypage_paylater_categorypage_color" parameterized="true"/>
28+
<element name="payPaFrame" type="iframe" selector="//iframe[contains(@id, 'jsx-iframe')]"/>
29+
<element name="categoryClick" type="button" selector="//span[contains(text(), 'SimpleSubCategory')]"/>
30+
<element name="payPaliFrame" type="iframe" selector="//iframe[contains(@name, 'zoid__paypal_message')]"/>
31+
<element name="PaypallaterMessage" type="input" selector="//span[text()='Buy now, pay later.']"/>
32+
</section>
33+
</sections>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="ConfigPayPalStandardSuite">
10+
<before>
11+
<!-- Login -->
12+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
13+
<!--Config PayPal Standard-->
14+
<actionGroup ref="AdminPayPalStandardEnableActionGroup" stepKey="ConfigPayPalStandard"/>
15+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
16+
<argument name="tags" value="config full_page"/>
17+
</actionGroup>
18+
</before>
19+
<after>
20+
<!-- Cleanup PayPal Standard configurations -->
21+
<magentoCLI command="config:set {{DisablePaypalPayStandard.path}} {{DisablePaypalPayStandard.value}}" stepKey="disablePayPalStandard"/>
22+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
23+
<argument name="tags" value="config full_page"/>
24+
</actionGroup>
25+
</after>
26+
<include>
27+
<group name="paypalStandard"/>
28+
</include>
29+
</suite>
30+
</suites>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminConfigPaymentsStandardTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Payment methods"/>
14+
<title value="configuration for paypal pay later on Category page"/>
15+
<description value="Paypal Pay Later Message should display on Admin Category Page configuration"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-5639"/>
18+
<group value="paypalStandard"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleSubCategory" stepKey="simpleCategory"/>
22+
<createData entity="SimpleProduct" stepKey="simpleProduct">
23+
<requiredEntity createDataKey="simpleCategory"/>
24+
</createData>
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<actionGroup ref="AdminPayPalStandardEnableActionGroup" stepKey="ConfigPaymentsStandard">
27+
</actionGroup>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
31+
<deleteData createDataKey="simpleCategory" stepKey="deleteCategory"/>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
33+
</after>
34+
<actionGroup ref="EnablePaypalPaylaterConfigurationActionGroup" stepKey="enablePaylaterCategoryPage">
35+
</actionGroup>
36+
<!-- Reindex and cache flush -->
37+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPage">
38+
<argument name="indices" value=""/>
39+
</actionGroup>
40+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePage">
41+
<argument name="tags" value=""/>
42+
</actionGroup>
43+
<!--Navigate to Storefront-->
44+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
45+
<waitForPageLoad stepKey="waitForProductPage"/>
46+
<waitForElementClickable selector="{{PayPalStandardConfigSection.categoryClick}}" stepKey="waitForCategryToClickable"/>
47+
<click selector ="{{PayPalStandardConfigSection.categoryClick}}" stepKey="clickCatagoryeButton"/>
48+
<waitForPageLoad stepKey="waitForCategrypageTobeLoaded"/>
49+
<waitForElementVisible selector="{{PayPalStandardConfigSection.payPaliFrame}}" stepKey="waitForElement"/>
50+
<switchToIFrame selector="{{PayPalStandardConfigSection.payPaliFrame}}" stepKey="switchToBuyNowPaylaterIFrame"/>
51+
<seeElement selector="{{PayPalStandardConfigSection.PaypallaterMessage}}" stepKey="verifyBuyNowPaylaterMessage"/>
52+
<switchToIFrame stepKey="switchBackToMainPaypalFrame"/>
53+
<!--Disable Paypal Standard-->
54+
<actionGroup ref="AdminPayPalStandardDisableActionGroup" stepKey="disablePaypalStandard">
55+
</actionGroup>
56+
<!-- Reindex and cache flush -->
57+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAdminPage">
58+
<argument name="indices" value=""/>
59+
</actionGroup>
60+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAdminPage">
61+
<argument name="tags" value=""/>
62+
</actionGroup>
63+
<!--Validate Paylater Message On Storefront Category Page-->
64+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFrontPage"/>
65+
<waitForPageLoad stepKey="waitForItemPage"/>
66+
<waitForElementClickable selector="{{PayPalStandardConfigSection.categoryClick}}" stepKey="waitForCategryToBeClickable"/>
67+
<click selector ="{{PayPalStandardConfigSection.categoryClick}}" stepKey="clickCatagoryeTab"/>
68+
<waitForPageLoad stepKey="waitForCategoryPageTobeLoaded"/>
69+
<dontSeeElement selector="{{PayPalStandardConfigSection.PaypallaterMessage}}" stepKey="verifyPaylaterMessageToBeDisappeared"/>
70+
</test>
71+
</tests>
72+
73+
74+

0 commit comments

Comments
 (0)