Skip to content

Commit bba1b74

Browse files
committed
Merge branch 'ACQE-6733' into ACQE-7157-functional-tests-mainline-deployment
2 parents 6336e3f + 6485a8f commit bba1b74

File tree

5 files changed

+171
-0
lines changed

5 files changed

+171
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillTermsAndConditionsCustomStoreViewActionGroup" extends="AdminTermsConditionsFillTermEditFormActionGroup">
12+
<arguments>
13+
<argument name="storeView" type="string" defaultValue="customStoreEN.name"/>
14+
</arguments>
15+
16+
<remove keyForRemoval="selectOptionStoreView"/>
17+
<selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{storeView}}" stepKey="selectOptionStoreView" />
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontTermInCheckoutAndPlaceOrderActionGroup">
12+
<arguments>
13+
<argument name="termCheckboxText" type="string"/>
14+
</arguments>
15+
<!--Check if agreement is present on checkout and select it-->
16+
<scrollTo selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="scrollToCheckoutAgreementBlock"/>
17+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="waitForCheckoutAgreementBlockToBeClickable"/>
18+
<click selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBlock}}" stepKey="clickCheckoutAgreementBlock"/>
19+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="waitForCheckAgreementToBeClickable"/>
20+
<selectOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckboxInput}}" userInput="{{termCheckboxText}}" stepKey="checkAgreement"/>
21+
<!--Checkout select Check/Money Order payment-->
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
<waitForElementClickable selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButtonClickable"/>
24+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
25+
<waitForPageLoad stepKey="waitForOrderPlaced"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
<data key="checkboxText" unique="suffix">test_checkbox</data>
5454
<data key="content" unique="suffix">TestMessage</data>
5555
</entity>
56+
<entity name="enableTextTerm" type="term">
57+
<data key="name">Test Condition</data>
58+
<data key="isActive">Enabled</data>
59+
<data key="isHtml">Text</data>
60+
<data key="mode">Manually</data>
61+
<data key="checkboxText">Terms and Conditions</data>
62+
<data key="content">terms text</data>
63+
</entity>
5664
<entity name="enableTermsAndConditions" type="term">
5765
<data key="path">checkout/options/enable_agreements</data>
5866
<data key="value">1</data>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCheckoutAgreementsSection">
12+
<element name="checkoutAgreementCheckboxInput" type="checkbox" selector="input#agreement_checkmo_3.required-entry"/>
13+
<element name="checkoutAgreementBlock" type="checkbox" selector=".checkout-agreements-block"/>
1214
<element name="checkoutAgreementCheckbox" type="checkbox" selector="div.checkout-agreement.field.choice.required > input"/>
1315
<element name="checkoutAgreementButton" type="button" selector="div.checkout-agreements-block > div > div > div > label > button > span"/>
1416
<element name="checkoutAgreementErrorMessage" type="button" selector="div.checkout-agreement.field.choice.required > div.mage-error"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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

Comments
 (0)