|
| 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="StoreFrontManualTermsAndConditionsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CheckoutAgreements"/> |
| 14 | + <stories value="Verify that Manual Terms and Condition is still required to be accept even payment solution was changed"/> |
| 15 | + <title value="Verify Terms and Conditions"/> |
| 16 | + <description value="Verify that Manual Terms and Condition is still required to be accept even payment solution was changed"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4723"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Create Category--> |
| 22 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 23 | + <!-- Create SimpleProductWithPrice100 --> |
| 24 | + <createData entity="SimpleProduct_100" stepKey="simpleProductOne"> |
| 25 | + <requiredEntity createDataKey="testCategory"/> |
| 26 | + </createData> |
| 27 | + <!-- Assign SimpleProductOne to Category --> |
| 28 | + <createData entity="AssignProductToCategory" stepKey="assignSimpleProductOneToTestCategory"> |
| 29 | + <requiredEntity createDataKey="testCategory"/> |
| 30 | + <requiredEntity createDataKey="simpleProductOne"/> |
| 31 | + </createData> |
| 32 | + <!-- Enable Terms And Condition--> |
| 33 | + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> |
| 34 | + <!--Login As Admin--> |
| 35 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 36 | + <!-- Open New Terms And Conditions Page--> |
| 37 | + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> |
| 38 | + <!-- Fill the Required Details--> |
| 39 | + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> |
| 40 | + <argument name="term" value="newHtmlTerm"/> |
| 41 | + </actionGroup> |
| 42 | + <grabTextFrom selector="{{AdminNewTermFormSection.conditionName}}" stepKey="conditionName"/> |
| 43 | + <!-- Save Details--> |
| 44 | + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveFilledTerm"/> |
| 45 | + <!--Enable Cash On Delivery Method --> |
| 46 | + <magentoCLI command="config:set {{CashOnDeliveryEnableConfigData.path}} {{CashOnDeliveryEnableConfigData.value}}" stepKey="enableCashOnDelivery"/> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/> |
| 50 | + <deleteData createDataKey="testCategory" stepKey="deleteTestCategory"/> |
| 51 | + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> |
| 52 | + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> |
| 53 | + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> |
| 54 | + <argument name="termName" value="{{newHtmlTerm.name}}"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> |
| 57 | + <magentoCLI command="config:set {{CashOnDeliveryDisabledConfigData.path}} {{CashOnDeliveryDisabledConfigData.value}}" stepKey="disabledCashOnDelivery"/> |
| 58 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 59 | + </after> |
| 60 | + <!--Go to product page--> |
| 61 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> |
| 62 | + <argument name="productUrlKey" value="$simpleProductOne.custom_attributes[url_key]$"/> |
| 63 | + </actionGroup> |
| 64 | + <!--Add Product to Shopping Cart--> |
| 65 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 66 | + <argument name="productName" value="$simpleProductOne.name$"/> |
| 67 | + </actionGroup> |
| 68 | + <!-- Proceed to Checkout--> |
| 69 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinCart"/> |
| 70 | + <!--Filling shipping information and click next--> |
| 71 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 72 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 73 | + <argument name="customerVar" value="Simple_US_Customer_NY"/> |
| 74 | + <argument name="customerAddressVar" value="US_Address_NY"/> |
| 75 | + </actionGroup> |
| 76 | + <!-- SelectCash On Delivery payment method --> |
| 77 | + <click selector="{{StorefrontCheckoutPaymentMethodsSection.cashOnDelivery}}" stepKey="selectCashOnDeliveryMethod"/> |
| 78 | + <!-- Verify Address is present--> |
| 79 | + <actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="checkBillingAddressOnBillingPage"> |
| 80 | + <argument name="customerVar" value="Simple_US_Customer_NY" /> |
| 81 | + <argument name="customerAddressVar" value="US_Address_NY" /> |
| 82 | + </actionGroup> |
| 83 | + <!--Check-box with text for Terms and Condition is present--> |
| 84 | + <seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckout"/> |
| 85 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermTextInCheckout"/> |
| 86 | + <!--Click Place Order--> |
| 87 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 88 | + <!-- Check "This is a required field." message is appeared under check-box--> |
| 89 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorTextInCheckout"/> |
| 90 | + <!-- Select Check Money Order--> |
| 91 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> |
| 92 | + <!--Section for *CheckMoneyOrder* is opened--> |
| 93 | + <seeElement selector ="{{AdminOrderFormPaymentSection.checkoutPaymentMethod('checkmo')}}" stepKey="checkMoneyOrderPageIsOpened"/> |
| 94 | + <!--Check Section for *Cash On Delivery* is closed --> |
| 95 | + <dontSeeElement selector ="{{AdminOrderFormPaymentSection.checkoutPaymentMethod('cashondelivery')}}" stepKey="cashOnDelivery"/> |
| 96 | + <!--Check-box with text for Terms and Condition is presented--> |
| 97 | + <seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckoutIsPresent"/> |
| 98 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermTextInCheckoutIsPresent"/> |
| 99 | + <!-- Click PLace Order--> |
| 100 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderAgain"/> |
| 101 | + <!--Check This is a required field." message is appeared under check-box --> |
| 102 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorMessage"/> |
| 103 | + <!-- Check check-box for Terms and Condition--> |
| 104 | + <selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="checkAgreement"/> |
| 105 | + <!-- Select Cash On Delivery payment method Again--> |
| 106 | + <click selector="{{StorefrontCheckoutPaymentMethodsSection.cashOnDelivery}}" stepKey="selectCashOnDeliveryMethodAgain"/> |
| 107 | + <!-- Check Address is present--> |
| 108 | + <actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="checkBillingAddressOnBillingPageAgain"> |
| 109 | + <argument name="customerVar" value="Simple_US_Customer_NY" /> |
| 110 | + <argument name="customerAddressVar" value="US_Address_NY" /> |
| 111 | + </actionGroup> |
| 112 | + <!--Check-box with text for Terms and Condition is presented--> |
| 113 | + <seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckoutAgain"/> |
| 114 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermTextInCheckoutAgain"/> |
| 115 | + <seeCheckboxIsChecked selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckboxcheck(newHtmlTerm.checkboxText)}}" stepKey="checkbox"/> |
| 116 | + <!-- Click PLace Order Again--> |
| 117 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="PlaceOrder"/> |
| 118 | + <!--This is a required field." message is appeared under check-box --> |
| 119 | + <see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeAgainErrorTextInCheckoutBox"/> |
| 120 | + </test> |
| 121 | +</tests> |
0 commit comments