Skip to content

Commit eaaa13f

Browse files
Merge branch 'ACQE-5770_1' into ACQE-6392
2 parents ece4f92 + 8c8342c commit eaaa13f

File tree

5 files changed

+167
-0
lines changed

5 files changed

+167
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminAssertEnableThisSolutionAndInContextCheckoutValueActionGroup" extends="AdminPayPalExpressCheckoutEnableActionGroup">
12+
<annotations>
13+
<description>Admin asserts enable this solution and enable in context checkout experience </description>
14+
</annotations>
15+
<arguments>
16+
<argument name="countryCode" type="string" defaultValue="us"/>
17+
</arguments>
18+
<seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo" after="enableSandboxMode"/>
19+
<assertElementContainsAttribute stepKey="seeInContextCheckoutIsDisabled" after="seeEnableThisSolutionIsSetAsNo">
20+
<expectedResult selector="{{PayPalExpressCheckoutConfigSection.enableInContext(countryCode)}}" attribute="disabled" type="string"></expectedResult>
21+
</assertElementContainsAttribute>
22+
<!-- Check that In-Context checkout experience is set to No and it is disabled -->
23+
<seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableInContext(countryCode)}}" userInput="No" stepKey="seeEnableEnableInContextCheckoutExprerienceIsSetAsNo" after="seeInContextCheckoutIsDisabled"/>
24+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown" after="enableSolution"/>
25+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.disabledEnableInContextCheckoutExp('us')}}" stepKey="assertGreenTickMarkForEnableInContextCheckoutExperience" after="assertGreenTickMarkForEnableThisSolutionDropdown"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 28 additions & 0 deletions
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="AdminClearPayPalExpressCheckoutDataActionGroup">
12+
<annotations>
13+
<description>Admin goes to paypal express checkout configuration and clears provided Sample PayPal credentials</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="countryCode" type="string" defaultValue="us"/>
17+
</arguments>
18+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad1"/>
20+
<waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="waitForConfigureButtonToBeAppeared"/>
21+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/>
22+
<waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/>
23+
<clearField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" stepKey="clearInputAPIUsernameField"/>
24+
<clearField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" stepKey="clearInputAPIPasswordField"/>
25+
<clearField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" stepKey="clearInputAPISignatureField"/>
26+
<selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="No" stepKey="disableSandboxMode"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
<element name="advancePaypalSettings" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced-head" parameterized="true" />
2828
<element name="paypalBillingAgreement" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_billing_agreement-head" parameterized="true" />
2929
<element name="billingDisable" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_settings_ec_advanced_express_checkout_billing_agreement_active" parameterized="true" />
30+
<element name="disabledEnableSolution" type="input" selector="//*[@id='row_payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_enable_express_checkout']//label[@class='enabled']" parameterized="true"/>
31+
<element name="disabledEnableInContextCheckoutExp" type="input" selector="//*[@id='row_payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_express_checkout_required_enable_in_context_checkout']//label[@class='enabled']" parameterized="true"/>
32+
<element name="closeButton" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}-head span[class='state-opened']" parameterized="true"/>
3033
<element name="basicPayPalSetting" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec-head" parameterized="true" />
3134
<element name="basicPayPalSettingOpen" type="button" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec-head.open" parameterized="true" />
3235
<element name="paymentAction" type="input" selector="#payment_{{countryCode}}_paypal_alternative_payment_methods_express_checkout_{{countryCode}}_settings_ec_payment_action" parameterized="true" />
36+
<element name="recommendedSolution" type="text" selector="#payment_{{countryCode}}_recommended_solutions-head" parameterized="true"/>
3337
</section>
3438
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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="AdminCheckConfigurationForPayPalExpressCheckoutInUnitesStatesTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Payment methods"/>
14+
<title value="Check config for PayPal Express Checkout in Unites States"/>
15+
<description value="Check paypal express checkout payment option's enablement and disablement based on the configuration setting in backend."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5499"/>
18+
</annotations>
19+
<before>
20+
<createData entity="SimpleProduct" stepKey="simpleProduct"/>
21+
<magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountryAsUS"/>
26+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpressAfterVerifyingInStorefront"/>
27+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
29+
</after>
30+
<!--Admin navigate to payment configuration page and assert no other paypal payment is enabled-->
31+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationToAssertNoOtherPaypalPaymentServiceEnabled"/>
32+
<dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="assertNoOtherPaypalPaymentServiceEnabled"/>
33+
<!--Clear paypal express checkout config related data-->
34+
<actionGroup ref="AdminClearPayPalExpressCheckoutDataActionGroup" stepKey="clearPaypalExpressCheckoutConfigData"/>
35+
<!--Assert enable this solution is set to No and disabled-->
36+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.enableSolution('us')}}" stepKey="waitForEnableThisSolutionField"/>
37+
<seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableSolution('us')}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo"/>
38+
<dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.disabledEnableSolution('us')}}" stepKey="seeEnableThisSolutionFieldIsDisabled"/>
39+
<!--Assert enable in-context checkout experience is set to No and disabled-->
40+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" stepKey="waitForEnableInContextCheckoutExpField"/>
41+
<seeOptionIsSelected selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" userInput="No" stepKey="seeEnableEnableInContextCheckoutExperienceIsSetAsNo"/>
42+
<dontSeeElement selector="{{PayPalExpressCheckoutConfigSection.disabledEnableInContextCheckoutExp('us')}}" stepKey="seeEnableInContextCheckoutExpFieldIsDisabled"/>
43+
<!--Go to Advanced settings -> Frontend Exp settings -> Features and see Paypal Credit option is not selected-->
44+
<scrollTo selector="{{PayPalExpressCheckoutConfigSection.recommendedSolution('us')}}" stepKey="scrollToRecommendedSolutionHeader"/>
45+
<waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="waitForCloseButtonToClick"/>
46+
<click selector="{{PayPalExpressCheckoutConfigSection.closeButton('us')}}" stepKey="clickCloseButton"/>
47+
<actionGroup ref="AdminOpenPayPalAdvancedFrontendExperienceFeaturesPageActionGroup" stepKey= "openFeatures"/>
48+
<dontSeeOptionIsSelected selector="{{PayPalAdvancedFrontendExperienceFeaturesSection.disableFundingOptionsMultiselect('us')}}" userInput="PayPal Credit" stepKey="dontSeePayPalCreditOptionIsSelected" />
49+
<!--Enable paypal solution-->
50+
<actionGroup ref="AdminAssertEnableThisSolutionAndInContextCheckoutValueActionGroup" stepKey= "adminConfigPaypalExpressCheckout"/>
51+
<!--Go to storefront and add product to cart -->
52+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
53+
<argument name="product" value="$$simpleProduct$$"/>
54+
</actionGroup>
55+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addTheProductToCart">
56+
<argument name="productName" value="$simpleProduct.name$"/>
57+
</actionGroup>
58+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
59+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
60+
<!--Place order-->
61+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="asAGuestFillShippingAddress">
62+
<argument name="shippingMethod" value="Flat Rate"/>
63+
</actionGroup>
64+
<waitForPageLoad stepKey="waitForShippingMethodToLoad"/>
65+
<waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsPresent"/>
66+
<!--Disable Paypal express checkout and assert Merchant ID field is disappeared-->
67+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpressAfterAssertingInStoreFront"/>
68+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/>
69+
<waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/>
70+
<waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/>
71+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/>
72+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.merchantID('us')}}" stepKey="assertMerchantIDFieldIsDisappeared"/>
73+
<assertElementContainsAttribute stepKey="seeInContextCheckoutIsDisabled">
74+
<expectedResult selector="{{PayPalExpressCheckoutConfigSection.enableInContext('us')}}" attribute="disabled" type="string"></expectedResult>
75+
</assertElementContainsAttribute>
76+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/>
77+
<actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/>
78+
<dontSee selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsAbsent"/>
79+
<!--Set Paypal Express Checkout to No and assert its status-->
80+
<magentoCLI command="config:set payment/paypal_express/active 1" stepKey="enablePayPalExpress"/>
81+
<amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterEnablingPaypal"/>
82+
<waitForPageLoad stepKey="waitForPaymentMethodPageToLoadAfterEnabling"/>
83+
<waitForElementClickable selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatusAfterEnabling"/>
84+
<click selector="{{PayPalExpressCheckoutConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatusAfterEnabling"/>
85+
<waitForElementVisible selector="{{PayPalExpressCheckoutConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown"/>
86+
<!--Go to checkout page and assert paypal express checkout option is present-->
87+
<actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsPresent"/>
88+
<waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout')}}" stepKey="assertPayPalExpressCheckoutIsPresent2"/>
89+
</test>
90+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup">
12+
<annotations>
13+
<description>Navigate to guest customer checkout review and payment page</description>
14+
</annotations>
15+
<amOnPage url="{{GuestCheckoutReviewAndPaymentsPage.url}}" stepKey="goToStoreFrontCheckoutPage"/>
16+
<waitForPageLoad stepKey="waitForShippingMethodToLoad"/>
17+
</actionGroup>
18+
</actionGroups>

0 commit comments

Comments
 (0)