Skip to content

Commit 92799c8

Browse files
committed
MC-29764: [FT] Test StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest randomly failed on Jenkins
1 parent 0595b0d commit 92799c8

15 files changed

+372
-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>

app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@
333333
<testCaseId value="MC-14785"/>
334334
<group value="CatalogSearch"/>
335335
<group value="mtf_migrated"/>
336+
<skip>
337+
<issueId value="MC-30161">[FT][2.3.5] Test QuickSearchAndAddToCart fails on Jenkins</issueId>
338+
</skip>
336339
</annotations>
337340
<before>
338341
<createData entity="_defaultCategory" stepKey="createCategory"/>
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="{{CheckoutCartMessageSection.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/CheckoutCartMessageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="successMessage" type="text" selector=".message.message-success.success>div" />
1313
<element name="errorMessage" type="text" selector=".message-error.error.message>div" />
1414
<element name="emptyCartMessage" type="text" selector=".cart-empty>p"/>
15+
<element name="errorMessageContainsText" type="text" selector="//div[contains(@class, 'message message-error error')]//div[contains(text(), '{{text}}')]" parameterized="true"/>
1516
</section>
1617
</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,204 @@
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+
61+
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
62+
</before>
63+
64+
<after>
65+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/>
66+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
67+
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
68+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
69+
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.default}}" stepKey="setFreeShippingMethodMinimumOrderAmountAsDefault" />
70+
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.disabled}}" stepKey="disableFreeShippingMethod" />
71+
<!--Reset configs-->
72+
<magentoCLI command="config:set {{AdminFedexDisableForCheckoutConfigData.path}} {{AdminFedexDisableForCheckoutConfigData.value}}" stepKey="disableCheckout"/>
73+
<magentoCLI command="config:set {{AdminFedexDisableSandboxModeConfigData.path}} {{AdminFedexDisableSandboxModeConfigData.value}}" stepKey="disableSandbox"/>
74+
<magentoCLI command="config:set {{AdminFedexDisableDebugConfigData.path}} {{AdminFedexDisableDebugConfigData.value}}" stepKey="disableDebug"/>
75+
<magentoCLI command="config:set {{AdminFedexDisableShowMethodConfigData.path}} {{AdminFedexDisableShowMethodConfigData.value}}" stepKey="disableShowMethod"/>
76+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/>
77+
<actionGroup ref="AdminSetStoreInformationConfigurationActionGroup" stepKey="resetStoreInformationConfig">
78+
<argument name="storeName" value=""/>
79+
<argument name="storeHoursOfOperation" value=""/>
80+
<argument name="vatNumber" value=""/>
81+
<argument name="telephone" value=""/>
82+
<argument name="country" value=""/>
83+
<argument name="state" value=""/>
84+
<argument name="city" value=""/>
85+
<argument name="postcode" value=""/>
86+
<argument name="street" value=""/>
87+
</actionGroup>
88+
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
89+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
90+
</after>
91+
92+
<!-- Guest Customer Test Scenario -->
93+
<!-- Add Simple Product to Cart -->
94+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart">
95+
<argument name="product" value="$$createSimpleProduct$$"/>
96+
</actionGroup>
97+
98+
<!-- Go to Checkout -->
99+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/>
100+
101+
<!-- Fill all required fields -->
102+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress">
103+
<argument name="customer" value="Simple_Customer_Without_Address" />
104+
<argument name="address" value="US_Address_TX"/>
105+
</actionGroup>
106+
<waitForLoadingMaskToDisappear stepKey="waitForFreeShippingMethodAppears"/>
107+
<!-- Select Free Shipping -->
108+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
109+
<argument name="shippingMethodName" value="Free Shipping"/>
110+
</actionGroup>
111+
112+
<!-- Go to Order review -->
113+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview"/>
114+
115+
<!-- Checkout select Check/Money Order payment -->
116+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
117+
<!-- Select payment solution -->
118+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" />
119+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
120+
121+
<!-- Apply Discount Coupon to the Order -->
122+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon">
123+
<argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/>
124+
</actionGroup>
125+
126+
<!-- Assert Shipping total is not yet calculated -->
127+
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated"/>
128+
129+
<!-- Assert order cannot be placed and error message will shown. -->
130+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderCannotBePlaced">
131+
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
132+
</actionGroup>
133+
134+
<!-- Go to checkout page -->
135+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/>
136+
137+
<!-- Chose flat rate -->
138+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFlatRate">
139+
<argument name="shippingMethodName" value="Flat Rate"/>
140+
</actionGroup>
141+
142+
<!-- Go to Order review -->
143+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutOrderReview"/>
144+
145+
<!-- Place order assert succeed -->
146+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
147+
148+
<!-- Loged in Customer Test Scenario -->
149+
<!-- Login with created Customer -->
150+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
151+
<argument name="Customer" value="$$createCustomer$$"/>
152+
</actionGroup>
153+
154+
<!-- Add Simple Product to Cart -->
155+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart">
156+
<argument name="product" value="$$createSimpleProduct$$"/>
157+
</actionGroup>
158+
159+
<!-- Go to Checkout -->
160+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="proceedToCheckout"/>
161+
<waitForLoadingMaskToDisappear stepKey="waitForShippingMethodAppears"/>
162+
<!-- Select Free Shipping -->
163+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFreeShippingMethod">
164+
<argument name="shippingMethodName" value="Free Shipping"/>
165+
</actionGroup>
166+
167+
<!-- Go to Order review -->
168+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
169+
170+
<!-- Checkout select Check/Money Order payment -->
171+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPaymentMethod"/>
172+
173+
<!-- Select payment solution -->
174+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="checkBillingAddressNotSameCheckbox"/>
175+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButtonVisible"/>
176+
177+
<!-- Apply Discount Coupon to the Order -->
178+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCouponCode">
179+
<argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/>
180+
</actionGroup>
181+
182+
<!-- Assert Shipping total is not yet calculated -->
183+
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertShippingTotalNotYetCalculated"/>
184+
185+
<!-- Assert order cannot be placed and error message will shown. -->
186+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderIsNotPlaced">
187+
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
188+
</actionGroup>
189+
190+
<!-- Go to checkout page -->
191+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutShippingPage"/>
192+
193+
<!-- Chose flat rate -->
194+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod">
195+
<argument name="shippingMethodName" value="Flat Rate"/>
196+
</actionGroup>
197+
198+
<!-- Go to Order review -->
199+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentStep"/>
200+
201+
<!-- Place order assert succeed -->
202+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
203+
</test>
204+
</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>

0 commit comments

Comments
 (0)