Skip to content

Commit b9c67f5

Browse files
ACQE-6108: Sign Up to Billing Agreement during checkout from mini Shopping Cart
1 parent 03621bb commit b9c67f5

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="orderNumberWithoutLink" type="text" selector="//div[contains(@class, 'checkout-success')]//p/span"/>
2323
<element name="orderLinkByOrderNumber" type="text" selector="//div[contains(@class,'success')]//a[contains(.,'{{orderNumber}}')]" parameterized="true" timeout="30"/>
2424
<element name="purchaseOrderNumber" type="text" selector="div.checkout-success > p:nth-child(1) > a span"/>
25+
<element name="billingAgreement" type="text" selector="//div[contains(@class, 'checkout-success')]/p[contains(text(), 'Your billing agreement # is:')]"/>
2526
</section>
2627
</sections>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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="StoreFrontPaypalExpressCheckoutWithBillingAgreementTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Paypal express checkout with billing agreement"/>
14+
<title value="Sign Up to Billing Agreement during checkout from mini Shopping Cart"/>
15+
<description value="Place an order with billing agreement using paypal express checkout as payment method"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-5547"/>
18+
</annotations>
19+
<before>
20+
<!-- Simple product is created -->
21+
<createData entity="SimpleProduct" stepKey="createProduct"/>
22+
<!-- US Customer is created -->
23+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<!-- Configure PayPal Express Checkout -->
26+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
27+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
28+
</actionGroup>
29+
<actionGroup ref="AdminPayPalExpressCheckoutEnableBillingAgreementActionGroup" stepKey="enableBillingAgreement">
30+
<argument name="countryCode" value="us"/>
31+
</actionGroup>
32+
<magentoCLI command="config:set payment/paypal_express/allow_ba_signup auto" stepKey="enableAutoBilling"/>
33+
</before>
34+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
35+
<argument name="tags" value="config full_page"/>
36+
</actionGroup>
37+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJob">
38+
<argument name="indices" value="cataloginventory_stock"/>
39+
</actionGroup>
40+
<!-- Login to StoreFront -->
41+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
42+
<argument name="Customer" value="$$createCustomer$$"/>
43+
</actionGroup>
44+
<!-- Add product to cart -->
45+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
46+
<argument name="product" value="$$createProduct$$"/>
47+
</actionGroup>
48+
<!-- Go to Checkout Page -->
49+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
50+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping" />
51+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/>
52+
<!-- Click on PayPal payment radio button -->
53+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
54+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
55+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
56+
<!-- Login to Paypal in-context-->
57+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
58+
<!-- Click PayPal button and go back to Magento site -->
59+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
60+
<!-- I see order successful Page -->
61+
<actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertOrderSuccess"/>
62+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
63+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.billingAgreement}}" stepKey="waitForBillingAgreement"/>
64+
<grabTextFrom selector="{{CheckoutSuccessMainSection.billingAgreement}}" stepKey="billingAgreement"/>
65+
<assertNotEmpty stepKey="assertOrderIdIsNotEmpty">
66+
<actualResult type="const">$orderNumber</actualResult>
67+
</assertNotEmpty>
68+
<assertNotEmpty stepKey="assertBillingAgreementIsNotEmpty">
69+
<actualResult type="const">$billingAgreement</actualResult>
70+
</assertNotEmpty>
71+
<after>
72+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
73+
<actionGroup ref="AdminPayPalExpressCheckoutDisableBillingAgreementActionGroup" stepKey="disableBillingAgreement">
74+
<argument name="countryCode" value="us"/>
75+
</actionGroup>
76+
<magentoCLI command="config:set payment/paypal_express/allow_ba_signup never" stepKey="disableAutoBilling"/>
77+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
78+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
79+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
80+
</after>
81+
</test>
82+
</tests>

0 commit comments

Comments
 (0)