|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 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="StorefrontAssertTermsAndConditionsIsPresentedOnStorefrontWithShowContentAsHtmlTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CheckoutAgreements"/> |
| 14 | + <stories value="Verify that Terms and Conditions is presented on Storefront with Show Content as Html."/> |
| 15 | + <title value="Verify Terms and Conditions with Show Content as Html"/> |
| 16 | + <description value="The testcase intends to Verify that Terms and Conditions is presented on Storefront with Show Content as Html."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4605"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 23 | + <actionGroup ref="AdminEnableTermsAndConditionsConfigurationActionGroup" stepKey="EnableTermsAndConditions"/> |
| 24 | + <!-- Create Additional store view --> |
| 25 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 26 | + <argument name="customStore" value="customStore"/> |
| 27 | + </actionGroup> |
| 28 | + </before> |
| 29 | + <after> |
| 30 | + <!--Delete created data--> |
| 31 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 32 | + <!--Delete custom store view --> |
| 33 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"> |
| 34 | + <argument name="customStore" value="customStore"/> |
| 35 | + </actionGroup> |
| 36 | + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> |
| 37 | + <actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/> |
| 38 | + <actionGroup ref="AdminDisableTermsAndConditionsConfigurationActionGroup" stepKey="DisableTermsAndConditions"/> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutOfAdmin"/> |
| 40 | + </after> |
| 41 | + <!-- Open New Terms And Conditions Page--> |
| 42 | + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> |
| 43 | + <!-- Fill the Required Details--> |
| 44 | + <actionGroup ref="AdminFillTermsAndConditionsCustomStoreViewActionGroup" stepKey="fillNewTerm"> |
| 45 | + <argument name="term" value="manualHtmlTerm"/> |
| 46 | + <argument name="storeView" value="{{customStore.name}}"/> |
| 47 | + </actionGroup> |
| 48 | + <!-- Save Details--> |
| 49 | + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveFilledTerm"/> |
| 50 | + <!-- Switch StoreView --> |
| 51 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreFrontHomePage"/> |
| 52 | + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> |
| 53 | + <argument name="storeView" value="customStore"/> |
| 54 | + </actionGroup> |
| 55 | + <!--Add product to cart.--> |
| 56 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 57 | + <argument name="product" value="$createSimpleProduct$"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 60 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 61 | + <!--Filling shipping information and click next--> |
| 62 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 63 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 64 | + <argument name="customerVar" value="Simple_US_Customer_NY"/> |
| 65 | + <argument name="customerAddressVar" value="US_Address_NY"/> |
| 66 | + </actionGroup> |
| 67 | + <!--Check-box with text for Terms and Condition is present--> |
| 68 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.agreementMarkedText(manualHtmlTerm.checkboxText)}}" stepKey="seeTermTextInCheckoutIsPresent"/> |
| 69 | + <click selector="{{StorefrontCheckoutAgreementsSection.agreementMarkedText}}" stepKey="ClickOnTermsAndConditionsLink"/> |
| 70 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBoldContentMessage('bold text')}}" stepKey="verifyBoldTextMessage"/> |
| 71 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementItalicContentMessage('italic text')}}" stepKey="verifyItalicTextMessage"/> |
| 72 | + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="waitForCloseToBeClickable"/> |
| 73 | + <click selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="ClickOnClose"/> |
| 74 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 75 | + <actionGroup ref="StorefrontClickPlaceOrderButtonActionGroup" stepKey="clickPlacePurchaseOrder"/> |
| 76 | + <waitForText selector="{{StorefrontCheckoutAgreementsSection.mageError}}" userInput="This is a required field." stepKey="verifyErrorMessage"/> |
| 77 | + <checkOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckout"/> |
| 78 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="againClickPlacePurchaseOrder"/> |
| 79 | + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 80 | + <waitForText selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 81 | + </test> |
| 82 | +</tests> |
0 commit comments