Skip to content

Commit 509d70f

Browse files
shanthishanthi
authored andcommitted
Addign ACQE-4290
2 parents c452d30 + 087bd5c commit 509d70f

File tree

4 files changed

+140
-0
lines changed

4 files changed

+140
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="BillingAgreementPayPalPaymentActionGroup">
11+
<arguments>
12+
<argument name="credentials" defaultValue="_CREDS"/>
13+
</arguments>
14+
<fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/PAYPAL_LOGIN}}" stepKey="fillEmail"/>
15+
<click selector="{{PayPalPaymentSection.nextButton}}" stepKey="clickNext"/>
16+
<waitForElementVisible selector="{{PayPalPaymentSection.password}}" stepKey="waitForPasswordField"/>
17+
<fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/PAYPAL_PWD}}" stepKey="fillPassword"/>
18+
<click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="clickLogin"/>
19+
<waitForPageLoad stepKey="waitForLoginPageLoad"/>
20+
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminBillingAgreementSection">
11+
<element name="billingAgreementId" type="text" selector=".//*[@id='customer_edit_tab_agreements_table']//tbody/tr[1]/td[2]"/>
12+
</section>
13+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="StorefrontBillingAgreementSection">
11+
<element name="billingAgreementDropdown" type="select" selector="#payment_method"/>
12+
<element name="createButton" type="button" selector=".//*[@type='submit']/span[contains(text(),'Create')]"/>
13+
<element name="expandLogin" type="button" selector="#loadLogin"/>
14+
<element name="loginButton" type="button" selector="#submitLogin"/>
15+
<element name="agreeAndContinue" type="button" selector="#continue"/>
16+
<element name="billingAgreementId" type="text" selector=".//td[@class='col id']"/>
17+
<element name="successMessageNew" type="text" selector=".//*[@role='alert']//div" />
18+
</section>
19+
</sections>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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="CreateBillingAgreementFromCustomersAccountTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Billing Agreement"/>
14+
<title value="Create Billing Agreement from customer's Account"/>
15+
<description value="Create Billing Agreement from customer's Account"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5101"/>
18+
<group value="paypal"/>
19+
</annotations>
20+
<before>
21+
<!--Enable free shipping method -->
22+
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
23+
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<!-- New Customer -->
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer">
27+
<field key="firstname">John1</field>
28+
<field key="lastname">Doe1</field>
29+
</createData>
30+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
31+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminPayPalExpressCheckoutEnableBillingAgreementActionGroup" stepKey="enableBillingAgreement">
34+
<argument name="countryCode" value="us"/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
39+
<magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/>
40+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
41+
<magentoCLI command="config:set payment/wps_express/active 0" stepKey="disableWPSExpress"/>
42+
<magentoCLI command="config:set payment/hosted_pro/active 0" stepKey="disableHostedProExpress"/>
43+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
45+
</after>
46+
<!--Log in to Storefront as Customer-->
47+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUpNewUser">
48+
<argument name="Customer" value="$$createCustomer$$"/>
49+
</actionGroup>
50+
<!-- Go to Billing Agreement Section and click on dropdown-->
51+
<click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('Billing Agreements')}}" stepKey="clickOnMyOrders"/>
52+
<selectOption selector ="{{StorefrontBillingAgreementSection.billingAgreementDropdown}}" userInput="PayPal Billing Agreement" stepKey="enableSandboxMode"/>
53+
<click selector="{{StorefrontBillingAgreementSection.createButton}}" stepKey="clickCreateButton"/>
54+
<reloadPage stepKey="refreshPage1"/>
55+
<reloadPage stepKey="refreshPage2"/>
56+
<reloadPage stepKey="refreshPage3"/>
57+
<!-- Login to paypal to create Billing Agreement-->
58+
<click selector="{{StorefrontBillingAgreementSection.expandLogin}}" stepKey="expandLogin"/>
59+
<waitForPageLoad stepKey="waitToLoadLoginPage" time="10"/>
60+
<click selector="{{StorefrontBillingAgreementSection.loginButton}}" stepKey="clickOnLogin"/>
61+
<waitForPageLoad stepKey="waitForBillingAgreementPage" time="10"/>
62+
<actionGroup ref="BillingAgreementPayPalPaymentActionGroup" stepKey="loginPaypal"/>
63+
<click selector="{{StorefrontBillingAgreementSection.agreeAndContinue}}" stepKey="clickContinue"/>
64+
<waitForPageLoad stepKey="waitForAgreeAndContinue"/>
65+
<grabTextFrom selector="{{StorefrontBillingAgreementSection.billingAgreementId}}" stepKey="billingID"/>
66+
<grabTextFrom selector="{{StorefrontBillingAgreementSection.successMessageNew}}" stepKey="grabSuccessMessage"/>
67+
<waitForPageLoad stepKey="waitToGrabSuccessMessage" time="10"/>
68+
<!-- Assert Billing Agreement ID in Storefront-->
69+
<assertStringContainsString stepKey="AssertProduct2">
70+
<actualResult type="const">$grabSuccessMessage</actualResult>
71+
<expectedResult type="string">$billingID</expectedResult>
72+
</assertStringContainsString>
73+
<!-- Go to "all customers" page in Admin -->
74+
<actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="navigateToCustomersPage"/>
75+
<!-- Filter by first customer email and Verify Billing Agreement ID-->
76+
<actionGroup ref="AdminFilterCustomerGridByEmail" stepKey="filterByFullValue">
77+
<argument name="email" value="$$createCustomer.email$$"/>
78+
</actionGroup><actionGroup ref="AdminClickFirstRowEditLinkOnCustomerGridActionGroup" stepKey="openCustomerEditPage"/>
79+
<click selector="{{AdminCustomerInformationSection.billingAgreements}}" stepKey="clickOnBillingAgreements"/>
80+
<grabTextFrom selector="{{AdminBillingAgreementSection.billingAgreementId}}" stepKey="grabBillingID"/>
81+
<assertEquals stepKey="assertSecondProductMapPrice">
82+
<actualResult type="const">$grabBillingID</actualResult>
83+
<expectedResult type="string">$billingID</expectedResult>
84+
</assertEquals>
85+
</test>
86+
</tests>

0 commit comments

Comments
 (0)