|
| 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="AssertStorefrontTermsAndConditionsPresentedForNonMainWebsiteTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CheckoutAgreements"/> |
| 14 | + <stories value="Verify that Terms and Conditions is presented on storefront for non main website."/> |
| 15 | + <title value="Verify Terms and Conditions"/> |
| 16 | + <description value="The testcase intends to Verify that Terms and Conditions is presented on storefront for non main website."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4595"/> |
| 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 website--> |
| 25 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> |
| 26 | + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> |
| 27 | + <argument name="websiteCode" value="{{customWebsite.code}}"/> |
| 28 | + </actionGroup> |
| 29 | + <!-- Create Additional store --> |
| 30 | + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> |
| 31 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 32 | + <argument name="store" value="{{customStoreGroup.name}}"/> |
| 33 | + <argument name="rootCategory" value="Default Category"/> |
| 34 | + </actionGroup> |
| 35 | + <!-- Create Additional store view --> |
| 36 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 37 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 38 | + <argument name="customStore" value="customStoreEN"/> |
| 39 | + </actionGroup> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <!--Delete created data--> |
| 43 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 44 | + <!--Set the main website as default--> |
| 45 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setMainWebsiteAsDefault"> |
| 46 | + <argument name="websiteName" value="{{_defaultWebsite.name}}"/> |
| 47 | + </actionGroup> |
| 48 | + <!--Delete website--> |
| 49 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 50 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> |
| 53 | + <actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/> |
| 54 | + <actionGroup ref="AdminDisableTermsAndConditionsConfigurationActionGroup" stepKey="DisableTermsAndConditions"/> |
| 55 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutOfAdmin"/> |
| 56 | + </after> |
| 57 | + <!-- Open simple product to additional website --> |
| 58 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
| 59 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToAdditionalWebsite"> |
| 62 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unAssignProductFromDefaultWebsite"> |
| 65 | + <argument name="website" value="{{_defaultWebsite.name}}"/> |
| 66 | + </actionGroup> |
| 67 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> |
| 68 | + <!-- Open New Terms And Conditions Page--> |
| 69 | + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> |
| 70 | + <!-- Fill the Required Details--> |
| 71 | + <actionGroup ref="AdminFillTermsAndConditionsCustomStoreViewActionGroup" stepKey="fillNewTerm"> |
| 72 | + <argument name="term" value="enableTextTerm"/> |
| 73 | + <argument name="storeView" value="{{customStoreEN.name}}"/> |
| 74 | + </actionGroup> |
| 75 | + <!-- Save Details--> |
| 76 | + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveFilledTerm"/> |
| 77 | + <!--Set Additional website as default website--> |
| 78 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setAdditionalWebsiteAsDefault"> |
| 79 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 82 | + <argument name="indices" value="catalogsearch_fulltext catalog_category_product catalog_product_price catalogrule_rule"/> |
| 83 | + </actionGroup> |
| 84 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 85 | + <argument name="tags" value="config full_page"/> |
| 86 | + </actionGroup> |
| 87 | + <!--Add product to cart.--> |
| 88 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 89 | + <argument name="product" value="$createSimpleProduct$"/> |
| 90 | + </actionGroup> |
| 91 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> |
| 92 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> |
| 93 | + <!--Filling shipping information and click next--> |
| 94 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 95 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 96 | + <argument name="customerVar" value="Simple_US_Customer_NY"/> |
| 97 | + <argument name="customerAddressVar" value="US_Address_NY"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> |
| 100 | + <!--Check-box with text for Terms and Condition is present--> |
| 101 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckout"/> |
| 102 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton(enableTextTerm.checkboxText)}}" stepKey="seeTermTextInCheckoutIsPresent"/> |
| 103 | + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" stepKey="waitForTermsAndConditionsLinkToBeClickable"/> |
| 104 | + <click selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" stepKey="ClickOnTermsAndConditionsLink"/> |
| 105 | + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(enableTextTerm.content)}}" stepKey="verifyTextMessage"/> |
| 106 | + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="waitForCloseToBeClickable"/> |
| 107 | + <click selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="ClickOnClose"/> |
| 108 | + <actionGroup ref="StorefrontTermInCheckoutAndPlaceOrderActionGroup" stepKey="assertTermInCheckoutAndPlaceOrder"> |
| 109 | + <argument name="termCheckboxText" value="{{enableTextTerm.checkboxText}}"/> |
| 110 | + </actionGroup> |
| 111 | + <!--See success messages--> |
| 112 | + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 113 | + <waitForText selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 114 | + </test> |
| 115 | +</tests> |
0 commit comments