Skip to content

Commit 7f3456f

Browse files
committed
Merge branch 'ACQE-6116' into ACQE-7157-functional-tests-mainline-deployment
2 parents e842116 + 37f7b15 commit 7f3456f

File tree

2 files changed

+70
-5
lines changed

2 files changed

+70
-5
lines changed

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

Lines changed: 5 additions & 5 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,13 +13,14 @@
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>
26-
</actionGroups>
26+
</actionGroups>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="AdminCancelPaypalExpressCheckoutTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Cancel an order with paypal express checkout"/>
14+
<title value="Cancel an order with paypal express checkout with valid credentials"/>
15+
<description value="Cancel an order with paypal express checkout as payment method"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6116"/>
18+
<group value="3rd_party_integration"/>
19+
<group value="pr_exclude"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Product -->
23+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
24+
<field key="price">10</field>
25+
</createData>
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
<!-- Configure Paypal Express Checkout -->
28+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
29+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
30+
</actionGroup>
31+
</before>
32+
<after>
33+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
34+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
36+
</after>
37+
<!-- Go to storefront home page -->
38+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
39+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage">
40+
<argument name="product" value="$createSimpleProduct$"/>
41+
</actionGroup>
42+
<!-- Click on PayPal payment button -->
43+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
44+
<!-- display PayPal popup and close the PayPal popup-->
45+
<switchToNextTab stepKey="switchToDownloadedLinkTab"/>
46+
<waitForPageLoad stepKey="waitForPageLoad"/>
47+
<closeTab stepKey="closeStorefrontTab"/>
48+
<waitForPageLoad stepKey="waitForPageLoadAgain" time="30"/>
49+
<!-- Goes to Shopping Cart page and Product is added to cart -->
50+
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/>
51+
<seeInField userInput="1" selector="{{CheckoutCartProductSection.ProductQuantityByName($$createSimpleProduct.name$$)}}" stepKey="seeInQtyField20"/>
52+
<!-- Again Click on PayPal payment button -->
53+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtnAgain">
54+
<argument name="elementNumber" value="1"/>
55+
<argument name="frameName" value="myFrame2"/>
56+
</actionGroup>
57+
<!-- Login to Paypal in-context-->
58+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
59+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
60+
<actionGroup ref="StorefrontPlaceOrderOnOrderReviewPageActionGroup" stepKey="clickPlaceOrderBtn"/>
61+
<!-- I see order successful Page -->
62+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/>
63+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
64+
</test>
65+
</tests>

0 commit comments

Comments
 (0)