|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 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="pr_exclude"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Enable Terms And Condition--> |
| 22 | + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> |
| 23 | + <!--Create a simple product--> |
| 24 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 25 | + <!--Create a US Customer--> |
| 26 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 27 | + <!--Login to admin--> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <!--Create terms and conditions--> |
| 30 | + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> |
| 31 | + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> |
| 32 | + <argument name="term" value="newHtmlTerm"/> |
| 33 | + </actionGroup> |
| 34 | + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> |
| 35 | + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewHTMLTerm"/> |
| 36 | + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewHTMLTerm"> |
| 37 | + <argument name="term" value="newHtmlAutomaticallyTerm"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewHTMLTerm"/> |
| 40 | + <!--Clear cache and reindex--> |
| 41 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 42 | + <argument name="indices" value=""/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 45 | + <argument name="tags" value="config full_page"/> |
| 46 | + </actionGroup> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <!--Admin delete terms and condition--> |
| 50 | + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> |
| 51 | + <actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/> |
| 52 | + <!--Delete created product--> |
| 53 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 54 | + <!-- Delete created customer --> |
| 55 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 56 | + <!--Logout--> |
| 57 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 58 | + </after> |
| 59 | + <!--Login to storefront and open created simple product--> |
| 60 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 61 | + <argument name="Customer" value="$createCustomer$" /> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> |
| 64 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 65 | + </actionGroup> |
| 66 | + <!-- Add product to cart and then select shipping method on checkout page--> |
| 67 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 68 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 69 | + </actionGroup> |
| 70 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 71 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 72 | + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate"> |
| 73 | + <argument name="shippingMethodName" value="Flat Rate"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextOnShippingStep"/> |
| 76 | + <!--Assert the created terms and conditions--> |
| 77 | + <waitForText selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementLink('Credit Card (Payflow Link)')}}" userInput="{{newHtmlTerm.checkboxText}}" after="selectCreditCardPaymentMethod" stepKey="seeTermInCheckout"/> |
| 78 | + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreement(newHtmlAutomaticallyTerm.checkboxText)}}" stepKey="waitToClickOnHTMLTerm"/> |
| 79 | + <click selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreement(newHtmlAutomaticallyTerm.checkboxText)}}" stepKey="clickOnHTMLTerm"/> |
| 80 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlAutomaticallyTerm.content)}}" stepKey="verifyAutomaticTermContentTextMessage"/> |
| 81 | + </test> |
| 82 | +</tests> |
0 commit comments