Skip to content

Commit a089461

Browse files
author
OlgaVasyltsun
committed
Merge remote-tracking branch 'origin/MC-29764' into 2.3-develop-pr105
2 parents ff7b459 + be0c53d commit a089461

14 files changed

+366
-4
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminSetStoreInformationConfigurationActionGroup">
12+
<annotations>
13+
<description>Set Store Information configurations</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeName" type="string" defaultValue="{{AdminGeneralSetStoreNameConfigData.value}}"/>
17+
<argument name="storeHoursOfOperation" type="string" defaultValue="{{AdminGeneralSetStoreHoursConfigData.value}}"/>
18+
<argument name="vatNumber" type="string" defaultValue="{{AdminGeneralSetVatNumberConfigData.value}}"/>
19+
<argument name="telephone" type="string" defaultValue="{{US_Address_TX.telephone}}"/>
20+
<argument name="country" type="string" defaultValue="{{US_Address_TX.country_id}}"/>
21+
<argument name="state" type="string" defaultValue="{{US_Address_TX.state}}"/>
22+
<argument name="city" type="string" defaultValue="{{US_Address_TX.city}}"/>
23+
<argument name="postcode" type="string" defaultValue="{{US_Address_TX.postcode}}"/>
24+
<argument name="street" type="string" defaultValue="{{US_Address_TX.street[0]}}"/>
25+
</arguments>
26+
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{storeName}}'" stepKey="setStoreInformationName"/>
27+
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} '{{telephone}}'" stepKey="setStoreInformationPhone"/>
28+
<magentoCLI command="config:set {{AdminGeneralSetStoreHoursConfigData.path}} '{{storeHoursOfOperation}}'" stepKey="setStoreHoursInformation"/>
29+
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} '{{country}}'" stepKey="setStoreInformationCountry"/>
30+
<magentoCLI command="config:set {{AdminGeneralSetStateConfigData.path}} '{{state}}'" stepKey="setStoreInformationState"/>
31+
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} '{{city}}'" stepKey="setStoreInformationCity"/>
32+
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} '{{postcode}}'" stepKey="setStoreInformationPostcode"/>
33+
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{street}}'" stepKey="setStoreInformationStreetAddress"/>
34+
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} '{{vatNumber}}'" stepKey="setStoreInformationVatNumber"/>
35+
</actionGroup>
36+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminGeneralStoreInfomationConfigData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@
3030
<entity name="AdminGeneralSetStreetAddress2ConfigData">
3131
<data key="path">general/store_information/street_line2</data>
3232
</entity>
33+
<entity name="AdminGeneralSetStateConfigData">
34+
<data key="path">general/store_information/region_id</data>
35+
</entity>
36+
<entity name="AdminGeneralSetStoreHoursConfigData">
37+
<data key="path">general/store_information/hours</data>
38+
<data key="value">8AM-8PM</data>
39+
</entity>
3340
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontOrderIsNotPlacedActionGroup" extends="AssertStorefrontOrderCannotBePlacedActionGroup">
11+
<remove keyForRemoval="assertErrorMessage"/>
12+
<seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText(error)}}" stepKey="assertErrorMessageInDOM"/>
13+
</actionGroup>
14+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="StorefrontCheckoutClickNextOnShippingStepActionGroup" extends="StorefrontCheckoutForwardFromShippingStep">
12+
<scrollTo selector="{{CheckoutShippingSection.next}}" before="clickNext" stepKey="scrollToNextButton"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<section name="CheckoutHeaderSection">
1010
<element name="shippingMethodStep" type="text" selector=".opc-progress-bar-item:nth-of-type(1)"/>
1111
<element name="reviewAndPaymentsStep" type="text" selector=".opc-progress-bar-item:nth-of-type(2)"/>
12+
<element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/>
1213
</section>
1314
</sections>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest">
1111
<annotations>
12-
<title value="Not applicable Shipping Method In Review and Payment Step"/>
12+
<title value="DEPRECATED. Not applicable Shipping Method In Review and Payment Step"/>
1313
<stories value="Checkout Shipping Method Recalculation after Coupon Code Added"/>
1414
<description value="User should not be able to place order when free shipping declined after applying coupon code"/>
1515
<features value="Checkout"/>
@@ -18,7 +18,7 @@
1818
<useCaseId value="MC-21926"/>
1919
<group value="Checkout"/>
2020
<skip>
21-
<issueId value="MC-29764"/>
21+
<issueId value="DEPRECATED">Use StorefrontShippingMethodIsNotApplicableInReviewAndPaymentStepTest instead</issueId>
2222
</skip>
2323
</annotations>
2424

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontShippingMethodIsNotApplicableInReviewAndPaymentStepTest">
11+
<annotations>
12+
<title value="Not applicable Shipping Method In Review and Payment Step"/>
13+
<stories value="Checkout Shipping Method Recalculation after Coupon Code Added"/>
14+
<description value="User should not be able to place order when free shipping declined after applying coupon code"/>
15+
<features value="Checkout"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-22625"/>
18+
<useCaseId value="MC-21926"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<!-- Enable Free Shipping Method and set Minimum Order Amount to 100-->
24+
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.enabled}}" stepKey="enableFreeShippingMethod" />
25+
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.hundred}}" stepKey="setFreeShippingMethodMinimumOrderAmountToBe100" />
26+
27+
<!--Set Fedex configs data-->
28+
<magentoCLI command="config:set {{AdminFedexEnableForCheckoutConfigData.path}} {{AdminFedexEnableForCheckoutConfigData.value}}" stepKey="enableCheckout"/>
29+
<magentoCLI command="config:set {{AdminFedexEnableSandboxModeConfigData.path}} {{AdminFedexEnableSandboxModeConfigData.value}}" stepKey="enableSandbox"/>
30+
<magentoCLI command="config:set {{AdminFedexEnableDebugConfigData.path}} {{AdminFedexEnableDebugConfigData.value}}" stepKey="enableDebug"/>
31+
<magentoCLI command="config:set {{AdminFedexEnableShowMethodConfigData.path}} {{AdminFedexEnableShowMethodConfigData.value}}" stepKey="enableShowMethod"/>
32+
33+
<!--Set StoreInformation configs data-->
34+
<actionGroup ref="AdminSetStoreInformationConfigurationActionGroup" stepKey="setStoreInformationConfigData">
35+
<argument name="telephone" value="{{DE_Address_Berlin_Not_Default_Address.telephone}}"/>
36+
<argument name="country" value="{{DE_Address_Berlin_Not_Default_Address.country_id}}"/>
37+
<argument name="state" value="{{DE_Address_Berlin_Not_Default_Address.state}}"/>
38+
<argument name="city" value="{{DE_Address_Berlin_Not_Default_Address.city}}"/>
39+
<argument name="postcode" value="{{DE_Address_Berlin_Not_Default_Address.postcode}}"/>
40+
<argument name="street" value="{{DE_Address_Berlin_Not_Default_Address.street[0]}}"/>
41+
</actionGroup>
42+
43+
<!--Set Shipping settings origin data-->
44+
<actionGroup ref="AdminSetShippingOriginConfigurationActionGroup" stepKey="setShippingOriginConfigurationData">
45+
<argument name="address" value="DE_Address_Berlin_Not_Default_Address"/>
46+
</actionGroup>
47+
48+
<!-- Create Simple Product -->
49+
<createData entity="defaultSimpleProduct" stepKey="createSimpleProduct">
50+
<field key="price">100</field>
51+
</createData>
52+
<!-- Create Cart Price Rule with 10% discount -->
53+
<createData entity="ApiSalesRule" stepKey="createCartPriceRule"/>
54+
<!-- Create Coupon code for the Cart Price Rule -->
55+
<createData entity="ApiSalesRuleCoupon" stepKey="createCartPriceRuleCoupon">
56+
<requiredEntity createDataKey="createCartPriceRule"/>
57+
</createData>
58+
<!-- Create Customer with filled Shipping & Billing Address -->
59+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
60+
</before>
61+
62+
<after>
63+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/>
64+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
65+
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
66+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
67+
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.default}}" stepKey="setFreeShippingMethodMinimumOrderAmountAsDefault" />
68+
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.disabled}}" stepKey="disableFreeShippingMethod" />
69+
<!--Reset configs-->
70+
<magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableCheckout"/>
71+
<magentoCLI command="config:set {{AdminFedexDisableSandboxModeConfigData.path}} {{AdminFedexDisableSandboxModeConfigData.value}}" stepKey="disableSandbox"/>
72+
<magentoCLI command="config:set {{AdminFedexDisableDebugConfigData.path}} {{AdminFedexDisableDebugConfigData.value}}" stepKey="disableDebug"/>
73+
<magentoCLI command="config:set {{AdminFedexDisableShowMethodConfigData.path}} {{AdminFedexDisableShowMethodConfigData.value}}" stepKey="disableShowMethod"/>
74+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/>
75+
<actionGroup ref="AdminSetStoreInformationConfigurationActionGroup" stepKey="resetStoreInformationConfig">
76+
<argument name="storeName" value=""/>
77+
<argument name="storeHoursOfOperation" value=""/>
78+
<argument name="vatNumber" value=""/>
79+
<argument name="telephone" value=""/>
80+
<argument name="country" value=""/>
81+
<argument name="state" value=""/>
82+
<argument name="city" value=""/>
83+
<argument name="postcode" value=""/>
84+
<argument name="street" value=""/>
85+
</actionGroup>
86+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
87+
</after>
88+
89+
<!-- Guest Customer Test Scenario -->
90+
<!-- Add Simple Product to Cart -->
91+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart">
92+
<argument name="product" value="$$createSimpleProduct$$"/>
93+
</actionGroup>
94+
95+
<!-- Go to Checkout -->
96+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/>
97+
98+
<!-- Fill all required fields -->
99+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress">
100+
<argument name="customer" value="Simple_Customer_Without_Address" />
101+
<argument name="address" value="US_Address_TX"/>
102+
</actionGroup>
103+
<waitForLoadingMaskToDisappear stepKey="waitForFreeShippingMethodAppears"/>
104+
<!-- Select Free Shipping -->
105+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
106+
<argument name="shippingMethodName" value="Free Shipping"/>
107+
</actionGroup>
108+
109+
<!-- Go to Order review -->
110+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview"/>
111+
112+
<!-- Checkout select Check/Money Order payment -->
113+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
114+
<!-- Select payment solution -->
115+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" />
116+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
117+
118+
<!-- Apply Discount Coupon to the Order -->
119+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon">
120+
<argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/>
121+
</actionGroup>
122+
123+
<!-- Assert Shipping total is not yet calculated -->
124+
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated"/>
125+
126+
<!-- Assert order cannot be placed and error message will shown. -->
127+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderCannotBePlaced">
128+
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
129+
</actionGroup>
130+
131+
<!-- Go to checkout page -->
132+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/>
133+
134+
<!-- Chose flat rate -->
135+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFlatRate">
136+
<argument name="shippingMethodName" value="Flat Rate"/>
137+
</actionGroup>
138+
139+
<!-- Go to Order review -->
140+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutOrderReview"/>
141+
142+
<!-- Place order assert succeed -->
143+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
144+
145+
<!-- Loged in Customer Test Scenario -->
146+
<!-- Login with created Customer -->
147+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
148+
<argument name="Customer" value="$$createCustomer$$"/>
149+
</actionGroup>
150+
151+
<!-- Add Simple Product to Cart -->
152+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart">
153+
<argument name="product" value="$$createSimpleProduct$$"/>
154+
</actionGroup>
155+
156+
<!-- Go to Checkout -->
157+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="proceedToCheckout"/>
158+
<waitForLoadingMaskToDisappear stepKey="waitForShippingMethodAppears"/>
159+
<!-- Select Free Shipping -->
160+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFreeShippingMethod">
161+
<argument name="shippingMethodName" value="Free Shipping"/>
162+
</actionGroup>
163+
164+
<!-- Go to Order review -->
165+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
166+
167+
<!-- Checkout select Check/Money Order payment -->
168+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPaymentMethod"/>
169+
170+
<!-- Select payment solution -->
171+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="checkBillingAddressNotSameCheckbox"/>
172+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButtonVisible"/>
173+
174+
<!-- Apply Discount Coupon to the Order -->
175+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCouponCode">
176+
<argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/>
177+
</actionGroup>
178+
179+
<!-- Assert Shipping total is not yet calculated -->
180+
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertShippingTotalNotYetCalculated"/>
181+
182+
<!-- Assert order cannot be placed and error message will shown. -->
183+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderIsNotPlaced">
184+
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
185+
</actionGroup>
186+
187+
<!-- Go to checkout page -->
188+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutShippingPage"/>
189+
190+
<!-- Chose flat rate -->
191+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod">
192+
<argument name="shippingMethodName" value="Flat Rate"/>
193+
</actionGroup>
194+
195+
<!-- Go to Order review -->
196+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentStep"/>
197+
198+
<!-- Place order assert succeed -->
199+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
200+
</test>
201+
</tests>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@
327327
<data key="postcode">10789</data>
328328
<data key="telephone">333-33-333-33</data>
329329
<data key="country">Germany</data>
330+
<data key="state">Berlin</data>
330331
</entity>
331332
<entity name="US_Address_California">
332333
<data key="firstname">John</data>

app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyDiscountCodeActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<click selector="{{DiscountSection.DiscountTab}}" stepKey="clickToAddDiscount"/>
1616
<fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{discountCode}}" stepKey="fillFieldDiscountCode"/>
1717
<click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/>
18-
<waitForElement selector="{{DiscountSection.DiscountVerificationMsg}}" time="30" stepKey="waitForDiscountToBeAdded"/>
18+
<waitForElementVisible selector="{{DiscountSection.DiscountVerificationMsg}}" time="30" stepKey="waitForDiscountToBeAdded"/>
1919
<see selector="{{DiscountSection.DiscountVerificationMsg}}" userInput="Your coupon was successfully applied" stepKey="assertDiscountApplyMessage"/>
2020
</actionGroup>
2121
</actionGroups>

0 commit comments

Comments
 (0)