Skip to content

Commit dfbd8ae

Browse files
Neil RautNeil Raut
authored andcommitted
ACQE-6361: Notify invalid address for PayPal checkout
Updated SwitchToPayPalGroupBtnActionGroup
1 parent 31e30fa commit dfbd8ae

File tree

6 files changed

+28
-27
lines changed

6 files changed

+28
-27
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +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" timeout="3/>
45+
<element name="PayPalBtnLessTimeout" type="button" selector=".paypal-button.paypal-button-number-0" timeout="3"/>
4646
</section>
4747
</sections>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?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-
-->
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
@@ -15,6 +15,6 @@
1515
<arguments>
1616
<argument name="invalidAddressError" type="string"/>
1717
</arguments>
18-
<waitForElementVisible selector="{{invalidAddressError}}" stepKey="assertErrorMessage"/>
18+
<waitForElement selector="{{invalidAddressError}}" stepKey="assertErrorMessage"/>
1919
</actionGroup>
2020
</actionGroups>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?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-
-->
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">

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

Lines changed: 4 additions & 4 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-->
21-
<switchToIFrame userInput="myFrame" stepKey="switchToIframe"/>
22-
<waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
21+
<switchToIFrame userInput="{{frameName}}" stepKey="switchToIframe"/>
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<element name="expirationYear" type="input" selector="//input[@id='expdate_year']" timeout="10"/>
2626
<element name="cvv" type="input" selector="//input[@id='cvv2_number']" timeout="10"/>
2727
<element name="payNowBtn" type="button" selector="//input[@id='btn_pay_cc']" timeout="10"/>
28-
<element name="invalidAddressError" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']" timeout="5"/>
28+
<element name="invalidAddressError" type="text" selector="div.message.message-error.error" timeout="5"/>
2929
<element name="PayPalBtnLessTimeout" type="button" selector=".paypal-button.paypal-button-number-0" timeout="3"/>
3030
</section>
3131
</sections>

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?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-
-->
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
@@ -16,7 +16,6 @@
1616
<description value="Verify that customer is notified with error message about wrong address for PayPal on all Magento Storefront pages"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="AC-3995"/>
19-
<group value="paypal"/>
2019
<group value="paypalExpress"/>
2120
<!--<group value="pr_exclude"/>-->
2221
</annotations>
@@ -60,6 +59,7 @@
6059
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="[email protected]" stepKey="SetInvalidZipCode"/>
6160
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="[email protected]" stepKey="SetInvalidPhoneNumber"/>
6261
<!--Select Flat Rate shipping method-->
62+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRateShippingMethod"/>
6363
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
6464
<!--Navigate to Review and Payments page-->
6565
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToPaymentPage"/>
@@ -87,11 +87,12 @@
8787
<!-- Click on Paypal paypal button on mini cart page-->
8888
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtnFromMiniCart">
8989
<argument name="elementNumber" value="1"/>
90+
<argument name="frameName" value="myFrame2"/>
9091
</actionGroup>
9192
<!--Close Mini Cart-->
9293
<click selector="{{StorefrontMinicartSection.minicartclose}}" stepKey="closeMiniCart"/>
9394
<!--Assert invalid address error from mini cart page-->
94-
<actionGroup ref="StorefrontAssertInvalidAddressErrorActionGroup" stepKey="assertErrorMessage2">
95+
<actionGroup ref="StorefrontAssertInvalidAddressErrorActionGroup" stepKey="assertErrorMessageFromMiniCartPage">
9596
<argument name="invalidAddressError" value="{{CheckoutCartMessageSection.invalidAddressError}}"/>
9697
</actionGroup>
9798
</test>

0 commit comments

Comments
 (0)