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