Skip to content

Commit 6674eb0

Browse files
“Pavan-bj” “Pavan-bj” 
authored andcommitted
ACQE-6915 | Several Terms and Conditions with different types are shown on PayPal express checkout review page
1 parent edcd0dc commit 6674eb0

5 files changed

+128
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminDisableTermsAndConditionsConfigurationActionGroup">
11+
<annotations>
12+
<description>Disable Terms and Conditions On Configuration page.</description>
13+
</annotations>
14+
15+
<magentoCLI command="config:set {{disableTermsAndConditions.path}} {{disableTermsAndConditions.value}}" stepKey="DisableTermsAndConditions"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminEnableTermsAndConditionsConfigurationActionGroup">
11+
<annotations>
12+
<description>Enable Terms and Conditions On Configuration page.</description>
13+
</annotations>
14+
15+
<magentoCLI command="config:set {{enableTermsAndConditions.path}} {{enableTermsAndConditions.value}}" stepKey="EnableTermsAndConditions"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,21 @@
6262
<data key="checkboxText" unique="suffix">Terms and Conditions</data>
6363
<data key="content" unique="suffix">TestMessage</data>
6464
</entity>
65+
<entity name="enableTermsAndConditions" type="term">
66+
<data key="path">checkout/options/enable_agreements</data>
67+
<data key="value">1</data>
68+
</entity>
69+
<entity name="disableTermsAndConditions" type="term">
70+
<data key="path">checkout/options/enable_agreements</data>
71+
<data key="value">0</data>
72+
</entity>
73+
<entity name="newHtmlAutomaticallyTerm" type="term">
74+
<data key="name" unique="suffix">Test name</data>
75+
<data key="isActive">Enabled</data>
76+
<data key="isHtml">HTML</data>
77+
<data key="mode">Automatically</data>
78+
<data key="storeView">Default Store View</data>
79+
<data key="checkboxText" unique="suffix">test_checkbox</data>
80+
<data key="content" unique="suffix">TestMessage</data>
81+
</entity>
6582
</entities>

app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
<element name="checkoutAgreementCheckboxcheck" type="checkbox" selector="//span[text()='{{agreementname}}']/../../../input[@type='checkbox']" parameterized="true"/>
1616
<element name="checkoutAgreementLink" type="button" selector="//div[@id='checkout-payment-method-load']//label//span[contains(., '{{paymentName}}')]//ancestor::div[contains(@class, 'payment-method _active')]//div[contains(@class, 'checkout-agreements-block')]//span" parameterized="true"/>
1717
<element name="agreementClose" type="button" selector=".agreements-modal._show .action-close"/>
18+
<element name="contentArea" type="text" selector="//div[@class='modals-wrapper']//aside[@class='modal-popup agreements-modal modal-slide _inner-scroll _show']//div[@class='checkout-agreements-item-content' and contains(text(), '{{contentText}}')]" parameterized="true"/>
19+
<element name="close" type="button" selector="//div[@class='modals-wrapper']//aside[@class='modal-popup agreements-modal modal-slide _inner-scroll _show']//footer//span"/>
1820
</section>
1921
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontAssertSeveralTermsAndConditionsOnPayPalExpressCheckoutReviewPageTest">
12+
<annotations>
13+
<features value="CheckoutAgreements"/>
14+
<stories value="Checkout agreements and Paypal express checkout"/>
15+
<title value="Assert Several Terms And Conditions On PayPal Express Checkout Review Page"/>
16+
<description value="Several Terms and Conditions with different types are shown on PayPal express checkout review page"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4430"/>
19+
<group value="paypalExpress"/>
20+
<group value="3rd_party_integration" />
21+
</annotations>
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
24+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
25+
<actionGroup ref="AdminEnableTermsAndConditionsConfigurationActionGroup" stepKey="EnableTermsAndConditions"/>
26+
<createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/>
27+
</before>
28+
<after>
29+
<!--Delete created data-->
30+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
31+
<actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/>
32+
<actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/>
33+
<actionGroup ref="AdminDisableTermsAndConditionsConfigurationActionGroup" stepKey="disableTermsAndConditions"/>
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
35+
</after>
36+
<!-- create manual term -->
37+
<actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTermForManualTerm"/>
38+
<actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="createManualTerm">
39+
<argument name="term" value="newHtmlTerm"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveManualTerm"/>
42+
<!-- create automatic term -->
43+
<actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTermForAutomaticTerm"/>
44+
<actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="createAutomaticTerm">
45+
<argument name="term" value="newHtmlAutomaticallyTerm"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveAutomaticTerm"/>
48+
<!-- Login as customer -->
49+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
50+
<argument name="Customer" value="$$createCustomer$$"/>
51+
</actionGroup>
52+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
53+
<argument name="product" value="$createSimpleProduct$"/>
54+
</actionGroup>
55+
<!--Navigate to checkout-->
56+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
57+
<!-- Click next button to open payment section -->
58+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
59+
<!-- Click on PayPal payment radio button -->
60+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
61+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
62+
<!-- Verify both manual and automatic are present -->
63+
<waitForText selector="{{CheckoutPaymentSection.brainTreeManualCheckoutAgreementLink}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeManualTermTextInCheckoutIsPresent"/>
64+
<waitForText selector="{{CheckoutPaymentSection.brainTreeAutomaticCheckoutAgreementLink}}" userInput="{{newHtmlAutomaticallyTerm.checkboxText}}" stepKey="seeAutomaticTermTextInCheckoutIsPresent"/>
65+
<!-- open manual terms and conditions and verify content messages-->
66+
<waitForElementClickable selector="{{CheckoutPaymentSection.brainTreeManualCheckoutAgreementLink}}" stepKey="waitForManualTermTextInCheckoutIsClickable"/>
67+
<click selector="{{CheckoutPaymentSection.brainTreeManualCheckoutAgreementLink}}" stepKey="clickManualTermTextInCheckout"/>
68+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlTerm.content)}}" stepKey="verifyManualTermContentTextMessage"/>
69+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="waitForCloseToBeClickable"/>
70+
<click selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="ClickOnClose"/>
71+
<waitForElementClickable selector="{{CheckoutPaymentSection.brainTreeAutomaticCheckoutAgreementLink}}" stepKey="waitForAutomaticTermTextInCheckoutIsClickable"/>
72+
<click selector="{{CheckoutPaymentSection.brainTreeAutomaticCheckoutAgreementLink}}" stepKey="clickAutomaticTermTextInCheckoutIsClickable"/>
73+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlAutomaticallyTerm.content)}}" stepKey="verifyAutomaticTermContentTextMessage"/>
74+
</test>
75+
</tests>

0 commit comments

Comments
 (0)