Skip to content

Commit 8eaf6ef

Browse files
committed
ACQE-7005: Several Terms and Conditions with different types are presented on Payflow Link review page
Added files
1 parent 581b7ef commit 8eaf6ef

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
<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"/>
1919
<element name="manualCheckoutAgreementLink" type="button" selector="//input[starts-with(@id,'{{paymentName}}')]/..//label//span" parameterized="true"/>
2020
<element name="automaticCheckoutAgreementLink" type="button" selector="//input[starts-with(@id,'{{paymentName}}')]/..//following-sibling::div//button//span" parameterized="true"/>
21+
<element name="checkoutAgreement" type="button" selector="(//*[@class='checkout-agreements fieldset']//button/span[text()='{{agreement}}'])[4]" parameterized="true"/>
22+
<element name="checkoutAgreementContent" type="button" selector=".//*[@class='modal-popup agreements-modal modal-slide _inner-scroll _show']//div[@class='checkout-agreements-item-content']"/>
2123
</section>
2224
</sections>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="AdminConfigurePaypalPayflowLinkSuite">
10+
<before>
11+
<!-- Login -->
12+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
13+
<!--Config PayPal Payflow Link-->
14+
<actionGroup ref="AdminEnablePayPalPayFlowLinkActionGroup" stepKey="ConfigPayPalPayFlowLink">
15+
<argument name="credentials" value="SamplePaypalPaymentsFlowLinkConfig"/>
16+
</actionGroup>
17+
</before>
18+
<after>
19+
<!-- Cleanup Paypal configurations -->
20+
<actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/>
21+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache">
22+
<argument name="tags" value="config full_page"/>
23+
</actionGroup>
24+
</after>
25+
<include>
26+
<group name="paypalPayflowLink"/>
27+
</include>
28+
</suite>
29+
</suites>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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="StorefrontSeveralTermsAndConditionsWithDifferentTypesArePresentedOnPayflowLinkReviewPageTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Paypal payflow link"/>
14+
<title value="Several Terms and Conditions with different types are presented on Payflow Link review page"/>
15+
<description value="Admin creates several terms and conditions with different types and assert them on the payment type payflow link in the storefront's review and payments page"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-5204"/>
18+
<group value="paypalPayflowLink"/>
19+
<group value="3rd_party_integration"/>
20+
</annotations>
21+
<before>
22+
<!-- Enable Terms And Condition-->
23+
<magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/>
24+
<!--Create a simple product-->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
26+
<!--Create a US Customer-->
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
28+
<!--Login to admin-->
29+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
30+
<!--Create terms and conditions-->
31+
<actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/>
32+
<actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm">
33+
<argument name="term" value="newHtmlTerm"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/>
36+
<actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewHTMLTerm"/>
37+
<actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewHTMLTerm">
38+
<argument name="term" value="newHtmlAutomaticallyTerm"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewHTMLTerm"/>
41+
<!--Clear cache and reindex-->
42+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
43+
<argument name="indices" value=""/>
44+
</actionGroup>
45+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
46+
<argument name="tags" value="config full_page"/>
47+
</actionGroup>
48+
</before>
49+
<after>
50+
<!--Admin delete terms and condition-->
51+
<actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/>
52+
<actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/>
53+
<!--Delete created product-->
54+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
55+
<!-- Delete created customer -->
56+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
57+
<!--Logout-->
58+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
59+
</after>
60+
<!--Login to storefront and open created simple product-->
61+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
62+
<argument name="Customer" value="$createCustomer$" />
63+
</actionGroup>
64+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
65+
<argument name="product" value="$$createSimpleProduct$$"/>
66+
</actionGroup>
67+
<!-- Add product to cart and then select shipping method on checkout page-->
68+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
69+
<argument name="productName" value="$createSimpleProduct.name$"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
72+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
73+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate">
74+
<argument name="shippingMethodName" value="Flat Rate"/>
75+
</actionGroup>
76+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/>
77+
<!-- Checkout select Credit Card (Payflow link) and assert the created terms and conditions-->
78+
<conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Link)')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Link)')}}" visible="true" stepKey="selectCreditCardPaymentMethod"/>
79+
<waitForText selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementLink}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermInCheckout"/>
80+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreement(enabledHtmlTerm.checkboxText)}}" stepKey="waitToClickOnHTMLTerm"/>
81+
<click selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreement(enabledHtmlTerm.checkboxText)}}" stepKey="clickOnHTMLTerm"/>
82+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlAutomaticallyTerm.content)}}" stepKey="verifyAutomaticTermContentTextMessage"/>
83+
</test>
84+
</tests>

0 commit comments

Comments
 (0)