Skip to content

Commit 81d58fe

Browse files
committed
Merge branch 'ACQE-6361' into ACQE-7021-functional-tests-mainline-deployment
2 parents bfb1470 + bef3e44 commit 81d58fe

File tree

7 files changed

+155
-4
lines changed

7 files changed

+155
-4
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartMessageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="emptyCartMessage" type="text" selector=".cart-empty>p"/>
1515
<element name="errorMessageText" type="text" selector="//div[contains(@class, 'message-error')]/div[text()='{{var}}']" parameterized="true"/>
1616
<element name="backorderErrorMessage" type="text" selector=".//*[@class='cart item']//div[@class='cart item message notice']"/>
17+
<element name="invalidAddressError" type="text" selector="//div[contains(text(),'PayPal gateway has rejected request. A match of the Shipping Address City, State, and Postal Code failed (#10736: Shipping Address Invalid City State Postal Code)')]"/>
1718
</section>
1819
</sections>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@
4242
<element name="fptAmount" type="text" selector="//*[@id='cart-totals']//tr[@class='totals']//td[@class='amount']/span"/>
4343
<element name="canadaTaxAmount" type="text" selector="//span[@data-th='Canada-GST-5%']"/>
4444
<element name="canadaPstTaxAmount" type="text" selector="//span[@data-th='Canada-GST-PST-5%']"/>
45+
<element name="PayPalBtnLessTimeout" type="button" selector=".paypal-button.paypal-button-number-0"/>
4546
</section>
4647
</sections>
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="StorefrontAssertInvalidAddressErrorActionGroup">
12+
<annotations>
13+
<description>Storefront assert invalid address error through PayPal checkout on Checkout, Cart and Mini Cart page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="invalidAddressError" type="string"/>
17+
</arguments>
18+
<waitForElement selector="{{invalidAddressError}}" stepKey="assertErrorMessage"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="StorefrontSwitchPayPalGroupBtnWithLessTimeoutActionGroup">
12+
<annotations>
13+
<description>Switch to Paypal group button with less timeout</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="elementNumber" type="string" defaultValue="0"/>
17+
</arguments>
18+
<!--set ID for iframe of PayPal group button-->
19+
<executeJS function="document.getElementsByClassName('component-frame')[{{elementNumber}}].setAttribute('name', 'myFrame');" stepKey="setIDForIframe"/>
20+
<!--switch to iframe of PayPal group button-->
21+
<switchToIFrame userInput="myFrame" stepKey="switchToIframe"/>
22+
<!--click on PayPal button-->
23+
<scrollTo selector="{{CheckoutPaymentSection.PayPalBtnLessTimeout}}" x="0" y="-100" stepKey="scrollTowaitForPayPalBtn"/>
24+
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtnLessTimeout}}" stepKey="waitForPayPalBtn"/>
25+
<click selector="{{CheckoutPaymentSection.PayPalBtnLessTimeout}}" stepKey="clickPayPalBtn"/>
26+
<!--switch back to default iframe-->
27+
<switchToIFrame stepKey="switchBackToMainFrame"/>
28+
</actionGroup>
29+
</actionGroups>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
98
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1110
<actionGroup name="SwitchToPayPalGroupBtnActionGroup">
@@ -14,12 +13,13 @@
1413
</annotations>
1514
<arguments>
1615
<argument name="elementNumber" type="string" defaultValue="0"/>
16+
<argument name="frameName" type="string" defaultValue="myFrame"/>
1717
</arguments>
1818
<!--set ID for iframe of PayPal group button-->
19-
<executeJS function="document.getElementsByClassName('component-frame')[{{elementNumber}}].setAttribute('name', 'myFrame');" stepKey="setIDForIframe"/>
19+
<executeJS function="document.getElementsByClassName('component-frame')[{{elementNumber}}].setAttribute('name', '{{frameName}}');" stepKey="setIDForIframe"/>
2020
<!--switch to iframe of PayPal group button-->
2121
<switchToIFrame userInput="myFrame" stepKey="switchToIframe"/>
22-
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
22+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
2323
<click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/>
2424
<switchToIFrame stepKey="switchBackToMainFrame"/>
2525
</actionGroup>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<element name="payPalFrame" type="iframe" selector="//iframe[contains(@class, 'zoid-component-frame zoid-visible')]" timeout="5"/>
1414
<element name="smartButtonPayPalFrame" type="iframe" selector=".component-frame" timeout="10"/>
1515
<element name="PayPalPaymentRadio" type="radio" selector="input#paypal_express.radio" timeout="30"/>
16-
<element name="PayPalBtn" type="radio" selector=".paypal-button.paypal-button-number-0" timeout="30"/>
16+
<element name="PayPalBtn" type="button" selector="div.paypal-button.paypal-button-number-0" />
1717
<element name="ContinuePayPalBtn" type="radio" selector="//span[text()='Continue to PayPal']"/>
1818
<element name="PayPalExpressCheckoutPayFlowEdition" type="radio" selector="input#payflow_express.radio"/>
1919
<element name="continueButton" type="button" selector="//div[@class='payment-method _active']//button[@class='action primary checkout']/span[text()='Continue to PayPal']"/>
@@ -26,5 +26,7 @@
2626
<element name="expirationYear" type="input" selector="//input[@id='expdate_year']" timeout="10"/>
2727
<element name="cvv" type="input" selector="//input[@id='cvv2_number']" timeout="10"/>
2828
<element name="payNowBtn" type="button" selector="//input[@id='btn_pay_cc']" timeout="10"/>
29+
<element name="invalidAddressError" type="text" selector="div.message.message-error.error" timeout="5"/>
30+
<element name="PayPalBtnLessTimeout" type="button" selector=".paypal-button.paypal-button-number-0" timeout="3"/>
2931
</section>
3032
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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="StorefrontNotifyInvalidAddressToCustomerForPayPalCheckoutTest">
12+
<annotations>
13+
<features value="PayPal"/>
14+
<stories value="Notify invalid address for PayPal checkout"/>
15+
<title value="Customer is notified if address is invalid for PayPal through Checkout flow"/>
16+
<description value="Verify that customer is notified with error message about wrong address for PayPal on all Magento Storefront pages"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-3995"/>
19+
<group value="paypalExpress"/>
20+
<!--<group value="pr_exclude"/>-->
21+
</annotations>
22+
<before>
23+
<!--Login as Admin-->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<!--Create product-->
26+
<createData entity="SimpleProduct" stepKey="createProduct"/>
27+
</before>
28+
<after>
29+
<!--Delete product-->
30+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
31+
<!--Logout as Admin-->
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
33+
</after>
34+
<!--Navigate to storefront home page-->
35+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontHomePage"/>
36+
<!--Open product page-->
37+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openCreatedProductPage">
38+
<argument name="product" value="$$createProduct$$"/>
39+
</actionGroup>
40+
<!--Add product to cart-->
41+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
42+
<argument name="product" value="$$createProduct$$"/>
43+
<argument name="productCount" value="1"/>
44+
</actionGroup>
45+
<!--Navigate to shopping cart-->
46+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
47+
<!--Navigate to Shipping details page-->
48+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToShippingPage"/>
49+
<!--Enter static shipping details with invalid data-->
50+
<fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="johndoe@example.com" stepKey="setInvalidCustomerEmail"/>
51+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="johndoe@example.com" stepKey="SetInvalidCustomerFirstName"/>
52+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="johndoe@example.com" stepKey="SetInvalidCustomerLastName"/>
53+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="johndoe@example.com" stepKey="SetInvalidStreetAddress"/>
54+
<waitForElementVisible selector="{{CheckoutShippingSection.country}}" stepKey="waitToSelectCountry"/>
55+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="United States" stepKey="selectCountryInStorefrontAddressBook"/>
56+
<waitForElementVisible selector="{{CheckoutShippingSection.region}}" stepKey="waitToSelectState"/>
57+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="selectStateInStorefrontAddressBook"/>
58+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="johndoe@example.com" stepKey="SetInvalidCity"/>
59+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="johndoe@example.com" stepKey="SetInvalidZipCode"/>
60+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="johndoe@example.com" stepKey="SetInvalidPhoneNumber"/>
61+
<!--Select Flat Rate shipping method-->
62+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRateShippingMethod"/>
63+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
64+
<!--Navigate to Review and Payments page-->
65+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToPaymentPage"/>
66+
<!-- click on PayPal payment radio button -->
67+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPayPalExpressButton"/>
68+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalExpressButton"/>
69+
<!--Switch to paypal group and click on paypal button-->
70+
<actionGroup ref="StorefrontSwitchPayPalGroupBtnWithLessTimeoutActionGroup" stepKey="clickPayPalButtonFromCheckoutPage"/>
71+
<!--Assert invalid address error from checkout page-->
72+
<actionGroup ref="StorefrontAssertInvalidAddressErrorActionGroup" stepKey="assertInvalidAddressErrorFromCheckoutPage">
73+
<argument name="invalidAddressError" value="{{CheckoutPaymentSection.invalidAddressError}}"/>
74+
</actionGroup>
75+
<!--Navigate to shopping cart-->
76+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPageForAssertion"/>
77+
<!-- Click on Paypal paypal button on cart page-->
78+
<actionGroup ref="StorefrontSwitchPayPalGroupBtnWithLessTimeoutActionGroup" stepKey="clickPayPalBtnFromCartPage">
79+
<argument name="elementNumber" value="1"/>
80+
</actionGroup>
81+
<!--Assert invalid address error from cart page-->
82+
<actionGroup ref="StorefrontAssertInvalidAddressErrorActionGroup" stepKey="assertErrorMessageFromCartPage">
83+
<argument name="invalidAddressError" value="{{CheckoutCartMessageSection.invalidAddressError}}"/>
84+
</actionGroup>
85+
<!-- Open Mini Cart -->
86+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>
87+
<!-- Click on Paypal paypal button on mini cart page-->
88+
<actionGroup ref="StorefrontSwitchPayPalGroupBtnWithLessTimeoutActionGroup" stepKey="clickPayPalBtnFromMiniCart">
89+
<argument name="elementNumber" value="1"/>
90+
</actionGroup>
91+
<!--Close Mini Cart-->
92+
<click selector="{{StorefrontMinicartSection.minicartclose}}" stepKey="closeMiniCart"/>
93+
<!--Assert invalid address error from mini cart page-->
94+
<actionGroup ref="StorefrontAssertInvalidAddressErrorActionGroup" stepKey="assertErrorMessageFromMiniCartPage">
95+
<argument name="invalidAddressError" value="{{CheckoutCartMessageSection.invalidAddressError}}"/>
96+
</actionGroup>
97+
</test>
98+
</tests>

0 commit comments

Comments
 (0)