Skip to content

Commit bdf4809

Browse files
JhalakMathurshashikant.kumar
authored andcommitted
AC-4723
1 parent c766d6c commit bdf4809

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="checkoutAgreementCheckbox" type="checkbox" selector="div.checkout-agreement.field.choice.required > input"/>
1313
<element name="checkoutAgreementButton" type="button" selector="div.checkout-agreements-block > div > div > div > label > button > span"/>
1414
<element name="checkoutAgreementErrorMessage" type="button" selector="div.checkout-agreement.field.choice.required > div.mage-error"/>
15+
<element name="checkoutPaymentMethod" type="radio" selector="//div[@class='payment-method _active']/div/input[@id= '{{methodName}}']" parameterized="true"/>
1516
</section>
1617
</sections>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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="savefillterm"/>
45+
<!-- Enable Check Money Order Method-->
46+
<actionGroup ref="CliEnableCheckMoneyOrderPaymentMethodActionGroup" stepKey="enableCheckMoneyOrderPaymentMethod"/>
47+
<!--Enable Cash On Delivery Method -->
48+
<magentoCLI command="config:set {{CashOnDeliveryEnableConfigData.path}} {{CashOnDeliveryEnableConfigData.value}}" stepKey="enableCashOndelivery"/>
49+
</before>
50+
<after>
51+
<deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/>
52+
<deleteData createDataKey="testCategory" stepKey="deleteTestCategory"/>
53+
<magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/>
54+
<actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/>
55+
<actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete">
56+
<argument name="termName" value="{{newHtmlTerm.name}}"/>
57+
</actionGroup>
58+
<actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/>
59+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
60+
</after>
61+
<!--Go to product page-->
62+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
63+
<argument name="productUrlKey" value="$simpleProductOne.custom_attributes[url_key]$"/>
64+
</actionGroup>
65+
<!--Add Product to Shopping Cart-->
66+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
67+
<argument name="productName" value="$simpleProductOne.name$"/>
68+
</actionGroup>
69+
<!-- Proceed to Checkout-->
70+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinCart"/>
71+
<!--Filling shipping information and click next-->
72+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
73+
<argument name="shippingMethod" value="Flat Rate"/>
74+
<argument name="customerVar" value="Simple_US_Customer_NY"/>
75+
<argument name="customerAddressVar" value="US_Address_NY"/>
76+
</actionGroup>
77+
<!-- SelectCash On Delivery payment method -->
78+
<click selector="{{StorefrontCheckoutPaymentMethodsSection.cashOnDelivery}}" stepKey="selectCashOnDeliveryMethod"/>
79+
<!-- Verify Address is present-->
80+
<actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="checkBillingAddressOnBillingPage">
81+
<argument name="customerVar" value="Simple_US_Customer_NY" />
82+
<argument name="customerAddressVar" value="US_Address_NY" />
83+
</actionGroup>
84+
<!--Check-box with text for Terms and Condition is present-->
85+
<seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckout"/>
86+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermtextInCheckout"/>
87+
<!--Click Place Order-->
88+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
89+
<!-- Check "This is a required field." message is appeared under check-box-->
90+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorextInCheckout"/>
91+
<!-- Select Check Money Order-->
92+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/>
93+
<!--Section for *CheckMoneyOrder* is opened-->
94+
<seeElement selector ="{{StorefrontCheckoutAgreementsSection.checkoutPaymentMethod('checkmo')}}" stepKey="checkmoneyOrderisopened"/>
95+
<!--Check Section for *Cash On Delivery* is closed -->
96+
<dontSeeElement selector ="{{StorefrontCheckoutAgreementsSection.checkoutPaymentMethod('cashondelivery')}}" stepKey="cashondelivery"/>
97+
<!--Check-box with text for Terms and Condition is presented-->
98+
<seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckoutispresent"/>
99+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermtextInCheckoutispresent"/>
100+
<!-- Click PLace Order-->
101+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderagain"/>
102+
<!--Check This is a required field." message is appeared under check-box -->
103+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeErrorMessage"/>
104+
<!-- Check check-box for Terms and Condition-->
105+
<selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="checkAgreement"/>
106+
<!-- Select Cash On Delivery payment method Again-->
107+
<click selector="{{StorefrontCheckoutPaymentMethodsSection.cashOnDelivery}}" stepKey="selectCashOnDeliveryMethodagain"/>
108+
<!-- Check Address is present-->
109+
<actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="checkBillingAddressOnBillingPageagain">
110+
<argument name="customerVar" value="Simple_US_Customer_NY" />
111+
<argument name="customerAddressVar" value="US_Address_NY" />
112+
</actionGroup>
113+
<!--Check-box with text for Terms and Condition is presented-->
114+
<seeElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckoutagain"/>
115+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementButton}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeTermtextInCheckoutagain"/>
116+
<!-- Verify Checkbox is not checked-->
117+
<dontSeeCheckboxIsChecked selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="checkboxNotChecked"/>
118+
<!-- Click PLace Order Again-->
119+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="PlaceOrder"/>
120+
<!--This is a required field." message is appeared under check-box -->
121+
<see selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementErrorMessage}}" userInput="This is a required field." stepKey="seeagainErrortextInCheckoutBox"/>
122+
</test>
123+
</tests>

0 commit comments

Comments
 (0)