Skip to content

Commit 5dbe3c6

Browse files
committed
Merge branch 'ACQE-6908' into ACQE-7152-mainline-functional-tests-deployment
2 parents 0be8207 + 23ba8c3 commit 5dbe3c6

4 files changed

+109
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest">
12+
<annotations>
13+
<features value="Payments"/>
14+
<stories value="Payflow Link"/>
15+
<title value="Apply gift cards and promo codes widget are shown on Order review page for Payflow Link"/>
16+
<description value="As a guest, apply coupon and gift card while placing an order through paypal payflow Link"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4378"/>
19+
</annotations>
20+
<before>
21+
<!--Create simple product-->
22+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct">
23+
<field key="price">100.00</field>
24+
</createData>
25+
<!--Create a customer-->
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<!--Login to admin site-->
28+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
29+
<!--Create cart price rule and coupon-->
30+
<actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule">
31+
<argument name="ruleName" value="CatPriceRule"/>
32+
<argument name="couponCode" value="CatPriceRule.coupon_code"/>
33+
</actionGroup>
34+
</before>
35+
<after>
36+
<!--Delete created product-->
37+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
38+
<!--Delete created cart price rule-->
39+
<actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/>
40+
<!--Delete created customer-->
41+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
42+
<!--Logout from admin site-->
43+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
44+
</after>
45+
<actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart">
46+
<argument name="product" value="$$createProduct$$"/>
47+
<argument name="quantity" value="1"/>
48+
</actionGroup>
49+
<!--Go to shopping cart-->
50+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
51+
<waitForElementVisible selector="{{CheckoutPaymentSection.checkoutWithPaypal}}" stepKey="waitForPayPalBtn"/>
52+
<click selector="{{CheckoutPaymentSection.checkoutWithPaypal}}" stepKey="clickPayPalBtn"/>
53+
<waitForElementClickable selector="{{CheckoutPaymentSection.reviewOrder}}" stepKey="waitForReviewOrderButtonToBeClickable"/>
54+
<click selector="{{CheckoutPaymentSection.reviewOrder}}" stepKey="clickReviewOrderButton"/>
55+
<waitForPageLoad stepKey="waitForPageLoad"/>
56+
</test>
57+
</tests>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -74,5 +74,7 @@
7474
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
7575
<element name="productChargedFor" type="text" selector="tr.totals.charge span.price"/>
7676
<element name="productCharged" type="text" selector="//tr[@class='grand totals']//span[@class='price' and contains(text(),'HK$')]"/>
77+
<element name="reviewOrder" type="button" selector="//div//button[text()='Continue to Review Order']"/>
78+
<element name="checkoutWithPaypal" type="button" selector="(//div[@class='cart-container']//input[@data-action='checkout-form-submit'])[1]" timeout="30"/>
7779
</section>
7880
</sections>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="StorefrontPayPalOrderReviewSection">
1111
<element name="shippingMethod" type="select" selector="#shipping-method"/>
1212
<element name="placeOrderBtn" type="button" selector="#review-button" timeout="30"/>
13+
<element name="applyDiscountCodeHeader" type="select" selector="//strong[text()='Apply Discount Code']"/>
14+
<element name="discountCodeField" type="input" selector=".control #coupon_code"/>
15+
<element name="applyDiscount" type="button" selector="//button//span[text()='Apply Discount']"/>
16+
<element name="grandTotal" type="text" selector="//td[@data-th='Grand Total']//strong"/>
1317
</section>
1418
</sections>
1519

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest">
12+
<annotations>
13+
<features value="Payments"/>
14+
<stories value="Payflow link"/>
15+
<title value="Apply gift cards or promo codes widget is shown on Order review page for Payflow link"/>
16+
<description value="As a guest, apply coupon and gift card while placing an order through paypal payflow link"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4378"/>
19+
<group value="3rd_party_integration"/>
20+
<group value="pr_exclude"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="AdminEnablePayPalPayFlowLinkActionGroup" stepKey="ConfigPayPalPayFlowLink" after="createCartPriceRule">
24+
<argument name="credentials" value="SamplePaypalPaymentsFlowLinkConfig"/>
25+
</actionGroup>
26+
</before>
27+
<after>
28+
<actionGroup ref="AdminDisablePayPalPayFlowLinkActionGroup" stepKey="disablePayPalPayFlow" after="deleteCustomer"/>
29+
</after>
30+
<!--Login to Paypal in-context-->
31+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal" after="clickPayPalBtn"/>
32+
<actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod" after="waitForPageLoad"/>
33+
<waitForElementClickable selector="{{StorefrontPayPalOrderReviewSection.applyDiscountCodeHeader}}" stepKey="waitForDiscountHeaderToBeClickable" after="selectShippingMethod"/>
34+
<click selector="{{StorefrontPayPalOrderReviewSection.applyDiscountCodeHeader}}" stepKey="clickDiscountHeader" after="waitForDiscountHeaderToBeClickable"/>
35+
<waitForElementVisible selector="{{StorefrontPayPalOrderReviewSection.discountCodeField}}" stepKey="waitForDiscountCodeFieldToBeVisible" after="clickDiscountHeader"/>
36+
<fillField selector="{{StorefrontPayPalOrderReviewSection.discountCodeField}}" userInput="{{CatPriceRule.coupon_code}}" stepKey="fillDiscountCodeField" after="waitForDiscountCodeFieldToBeVisible"/>
37+
<waitForElementClickable selector="{{StorefrontPayPalOrderReviewSection.applyDiscount}}" stepKey="waitForApplyDiscountToBeClickable" after="fillDiscountCodeField"/>
38+
<click selector="{{StorefrontPayPalOrderReviewSection.applyDiscount}}" stepKey="clickApplyDiscount" after="waitForApplyDiscountToBeClickable"/>
39+
<waitForPageLoad stepKey="waitForCouponToBeApplied" after="clickApplyDiscount"/>
40+
<waitForElement selector="{{StorefrontPayPalOrderReviewSection.grandTotal('$95.00')}}" stepKey="assertTotalAfterDiscountApplied" after="waitForCouponToBeApplied"/>
41+
</test>
42+
</tests>

0 commit comments

Comments
 (0)