Skip to content

Commit 2c56525

Browse files
committed
MC-29766: [Upport 2.4.0] [FT] Test StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest randomly failed on Jenkins
1 parent 03c84ec commit 2c56525

13 files changed

+216
-55
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="StorefrontCheckoutForwardFromShippingStepActionGroup">
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: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,34 @@
1616
<severity value="MAJOR"/>
1717
<testCaseId value="MC-22625"/>
1818
<useCaseId value="MC-21926"/>
19-
<group value="Checkout"/>
20-
<skip>
21-
<issueId value="MC-29597"/>
22-
</skip>
19+
<group value="checkout"/>
2320
</annotations>
2421

2522
<before>
2623
<!-- Enable Free Shipping Method and set Minimum Order Amount to 100-->
2724
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.enabled}}" stepKey="enableFreeShippingMethod" />
2825
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.hundred}}" stepKey="setFreeShippingMethodMinimumOrderAmountToBe100" />
2926

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+
3033
<!--Set StoreInformation configs data-->
31-
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} '{{AdminGeneralSetStoreNameConfigData.value}}'" stepKey="setStoreInformationName"/>
32-
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.telephone}}" stepKey="setStoreInformationPhone"/>
33-
<magentoCLI command="config:set {{AdminGeneralSetCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setStoreInformationCountry"/>
34-
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setStoreInformationCity"/>
35-
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setStoreInformationPostcode"/>
36-
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setStoreInformationStreetAddress"/>
37-
<magentoCLI command="config:set {{AdminGeneralSetStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setStoreInformationStreetAddress2"/>
38-
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} {{AdminGeneralSetVatNumberConfigData.value}}" stepKey="setStoreInformationVatNumber"/>
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>
3942

4043
<!--Set Shipping settings origin data-->
41-
<magentoCLI command="config:set {{AdminShippingSettingsOriginCountryConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.country_id}}" stepKey="setOriginCountry"/>
42-
<magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.city}}" stepKey="setOriginCity"/>
43-
<magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} {{DE_Address_Berlin_Not_Default_Address.postcode}}" stepKey="setOriginZipCode"/>
44-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} '{{DE_Address_Berlin_Not_Default_Address.street[0]}}'" stepKey="setOriginStreetAddress"/>
45-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} '{{US_Address_California.street[0]}}'" stepKey="setOriginStreetAddress2"/>
44+
<actionGroup ref="AdminSetShippingOriginConfigurationActionGroup" stepKey="setShippingOriginConfigurationData">
45+
<argument name="address" value="DE_Address_Berlin_Not_Default_Address"/>
46+
</actionGroup>
4647

4748
<!-- Create Simple Product -->
4849
<createData entity="defaultSimpleProduct" stepKey="createSimpleProduct">
@@ -56,9 +57,6 @@
5657
</createData>
5758
<!-- Create Customer with filled Shipping & Billing Address -->
5859
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
59-
60-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
61-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
6260
</before>
6361

6462
<after>
@@ -69,19 +67,23 @@
6967
<magentoCLI command="config:set {{AdminFreeshippingMinimumOrderAmountConfigData.path}} {{AdminFreeshippingMinimumOrderAmountConfigData.default}}" stepKey="setFreeShippingMethodMinimumOrderAmountAsDefault" />
7068
<magentoCLI command="config:set {{AdminFreeshippingActiveConfigData.path}} {{AdminFreeshippingActiveConfigData.disabled}}" stepKey="disableFreeShippingMethod" />
7169
<!--Reset configs-->
72-
<magentoCLI command="config:set {{AdminGeneralSetStoreNameConfigData.path}} ''" stepKey="setStoreInformationName"/>
73-
<magentoCLI command="config:set {{AdminGeneralSetStorePhoneConfigData.path}} ''" stepKey="setStoreInformationPhone"/>
74-
<magentoCLI command="config:set {{AdminGeneralSetCityConfigData.path}} ''" stepKey="setStoreInformationCity"/>
75-
<magentoCLI command="config:set {{AdminGeneralSetPostcodeConfigData.path}} ''" stepKey="setStoreInformationPostcode"/>
76-
<magentoCLI command="config:set {{AdminGeneralSetStreetAddressConfigData.path}} ''" stepKey="setStoreInformationStreetAddress"/>
77-
<magentoCLI command="config:set {{AdminGeneralSetStreetAddress2ConfigData.path}} ''" stepKey="setStoreInformationStreetAddress2"/>
78-
<magentoCLI command="config:set {{AdminGeneralSetVatNumberConfigData.path}} ''" stepKey="setStoreInformationVatNumber"/>
79-
<magentoCLI command="config:set {{AdminShippingSettingsOriginCityConfigData.path}} ''" stepKey="setOriginCity"/>
80-
<magentoCLI command="config:set {{AdminShippingSettingsOriginZipCodeConfigData.path}} ''" stepKey="setOriginZipCode"/>
81-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddressConfigData.path}} ''" stepKey="setOriginStreetAddress"/>
82-
<magentoCLI command="config:set {{AdminShippingSettingsOriginStreetAddress2ConfigData.path}} ''" stepKey="setOriginStreetAddress2"/>
83-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
84-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
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"/>
8587
</after>
8688

8789
<!-- Guest Customer Test Scenario -->
@@ -105,7 +107,7 @@
105107
</actionGroup>
106108

107109
<!-- Go to Order review -->
108-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview"/>
110+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutReview"/>
109111

110112
<!-- Checkout select Check/Money Order payment -->
111113
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
@@ -122,7 +124,7 @@
122124
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated"/>
123125

124126
<!-- Assert order cannot be placed and error message will shown. -->
125-
<actionGroup ref="AssertStorefrontOrderCannotBePlacedActionGroup" stepKey="assertOrderCannotBePlaced">
127+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderCannotBePlaced">
126128
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
127129
</actionGroup>
128130

@@ -135,7 +137,7 @@
135137
</actionGroup>
136138

137139
<!-- Go to Order review -->
138-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview2"/>
140+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutOrderReview"/>
139141

140142
<!-- Place order assert succeed -->
141143
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
@@ -147,53 +149,52 @@
147149
</actionGroup>
148150

149151
<!-- Add Simple Product to Cart -->
150-
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addProductToCart2">
152+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart">
151153
<argument name="product" value="$$createSimpleProduct$$"/>
152154
</actionGroup>
153155

154156
<!-- Go to Checkout -->
155-
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout2"/>
156-
157+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="proceedToCheckout"/>
157158
<!-- Select Free Shipping -->
158-
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping2">
159+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFreeShippingMethod">
159160
<argument name="shippingMethodName" value="Free Shipping"/>
160161
</actionGroup>
161162

162163
<!-- Go to Order review -->
163-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview3"/>
164+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
164165

165166
<!-- Checkout select Check/Money Order payment -->
166-
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment2"/>
167+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPaymentMethod"/>
167168

168169
<!-- Select payment solution -->
169-
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution2" />
170-
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton2"/>
170+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="checkBillingAddressNotSameCheckbox"/>
171+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButtonVisible"/>
171172

172173
<!-- Apply Discount Coupon to the Order -->
173-
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon2">
174+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCouponCode">
174175
<argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/>
175176
</actionGroup>
176177

177178
<!-- Assert Shipping total is not yet calculated -->
178-
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertNotYetCalculated2"/>
179+
<actionGroup ref="AssertStorefrontNotCalculatedValueInShippingTotalInOrderSummaryActionGroup" stepKey="assertShippingTotalNotYetCalculated"/>
179180

180-
<!-- Assert order cannot be placed and error message will shown. -->
181-
<actionGroup ref="AssertStorefrontOrderCannotBePlacedActionGroup" stepKey="assertOrderCannotBePlaced2">
181+
<!-- Assert order cannot be placed and error message will shown. -->
182+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="assertOrderIsNotPlaced">
182183
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
183184
</actionGroup>
184185

185186
<!-- Go to checkout page -->
186-
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage2"/>
187+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToCheckoutShippingPage"/>
187188

188189
<!-- Chose flat rate -->
189-
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFlatRate2">
190+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod">
190191
<argument name="shippingMethodName" value="Flat Rate"/>
191192
</actionGroup>
192193

193194
<!-- Go to Order review -->
194-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview4"/>
195+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentStep"/>
195196

196197
<!-- Place order assert succeed -->
197-
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder2"/>
198+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
198199
</test>
199200
</tests>

0 commit comments

Comments
 (0)