Skip to content

Commit 7c4e8cb

Browse files
committed
Merge remote-tracking branch 'origin/MC-39474' into 2.4-develop-pr112
2 parents d0854a3 + 6acc7ba commit 7c4e8cb

5 files changed

+114
-5
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest">
10+
<test name="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest" deprecated="Use StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest instead">
1111
<annotations>
12-
<title value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
12+
<title value="DEPRECATED. Checkout Free Shipping Recalculation after Coupon Code Added"/>
1313
<stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
1414
<description value="User should be able to do checkout free shipping recalculation after adding coupon code"/>
1515
<features value="Checkout"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MAGETWO-96537"/>
1818
<useCaseId value="MAGETWO-96431"/>
1919
<group value="Checkout"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest instead</issueId>
22+
</skip>
2023
</annotations>
2124

2225
<before>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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="StoreFrontFreeShippingRecalculationAfterCouponCodeAppliedTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
14+
<title value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
15+
<description value="User should be able to do checkout free shipping recalculation after adding coupon code"/>
16+
<severity value="BLOCKER"/>
17+
<testCaseId value="MC-28548"/>
18+
<useCaseId value="MAGETWO-96431"/>
19+
<group value="Checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer">
24+
<field key="group_id">1</field>
25+
</createData>
26+
<createData entity="_defaultCategory" stepKey="defaultCategory"/>
27+
<createData entity="_defaultProduct" stepKey="simpleProduct">
28+
<field key="price">90</field>
29+
<requiredEntity createDataKey="defaultCategory"/>
30+
</createData>
31+
<!--It is default for FlatRate-->
32+
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
33+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
34+
<createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/>
35+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
36+
<argument name="tags" value=""/>
37+
</actionGroup>
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
<actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/>
40+
<actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule">
41+
<argument name="ruleName" value="CatPriceRule"/>
42+
<argument name="couponCode" value="CatPriceRule.coupon_code"/>
43+
</actionGroup>
44+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront">
45+
<argument name="Customer" value="$createCustomer$"/>
46+
</actionGroup>
47+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
48+
<argument name="productUrl" value="$simpleProduct.custom_attributes[url_key]$"/>
49+
</actionGroup>
50+
</before>
51+
52+
<after>
53+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
54+
<deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/>
55+
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
56+
<createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/>
57+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
58+
59+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
60+
<argument name="tags" value=""/>
61+
</actionGroup>
62+
<actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/>
63+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
64+
</after>
65+
66+
<actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule">
67+
<argument name="product" value="$simpleProduct$"/>
68+
<argument name="couponCode" value="{{CatPriceRule.coupon_code}}"/>
69+
</actionGroup>
70+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/>
71+
<waitForPageLoad stepKey="waitForpageLoad1"/>
72+
<dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/>
73+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCartPage"/>
74+
<conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="openDiscountTabIfClosed"/>
75+
<waitForPageLoad stepKey="waitForCouponTabOpen1"/>
76+
<click selector="{{DiscountSection.CancelCoupon}}" stepKey="cancelCoupon"/>
77+
<waitForPageLoad stepKey="waitForCancel"/>
78+
<see userInput='You canceled the coupon code.' stepKey="seeCancellationMessage"/>
79+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/>
80+
<waitForPageLoad stepKey="waitForShippingMethods"/>
81+
<click selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="chooseFreeShipping"/>
82+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextAfterFreeShippingMethodSelection"/>
83+
<waitForPageLoad stepKey="waitForReviewAndPayments"/>
84+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCouponCode">
85+
<argument name="discountCode" value="{{CatPriceRule.coupon_code}}"/>
86+
</actionGroup>
87+
<!-- Assert order cannot be placed and error message will shown. -->
88+
<actionGroup ref="AssertStorefrontOrderIsNotPlacedActionGroup" stepKey="seeShippingMethodError">
89+
<argument name="error" value="The shipping method is missing. Select the shipping method and try again."/>
90+
</actionGroup>
91+
<amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/>
92+
<waitForPageLoad stepKey="waitForShippingPageLoad"/>
93+
94+
<click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/>
95+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
96+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNextAfterFlatRateShippingMethodSelection"/>
97+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/>
98+
<!-- Place Order -->
99+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="placeOrder">
100+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
101+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
102+
</actionGroup>
103+
</test>
104+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@
5858
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNextButton"/>
5959
<!-- Assert order cannot be placed and error message will shown. -->
6060
<waitForPageLoad stepKey="waitForError"/>
61-
<see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/>
61+
<seeElementInDOM selector="{{CheckoutHeaderSection.errorMessageContainsText('The shipping method is missing. Select the shipping method and try again')}}" stepKey="seeShippingMethodError"/>
6262
</test>
6363
</tests>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
<amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/>
2020
<waitForPageLoad stepKey="waitForPriceList"/>
2121
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
22+
<waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleName}}" stepKey="waitRuleNameFieldAppeared"/>
2223
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/>
2324
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{ruleName.websites}}" stepKey="selectWebsites"/>
2425
<selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" parameterArray="[{{ruleName.customerGroups}}]" stepKey="selectCustomerGroup"/>
2526
<click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/>
2627
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{ruleName.apply}}" stepKey="selectActionType"/>
2728
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{ruleName.discountAmount}}" stepKey="fillDiscountAmount"/>
2829
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
29-
<see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
30+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
31+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
3032
</actionGroup>
3133
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<arguments>
1313
<argument name="discountCode" type="string"/>
1414
</arguments>
15-
<click selector="{{DiscountSection.DiscountTab}}" stepKey="clickToAddDiscount"/>
15+
<conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickToAddDiscount"/>
1616
<fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{discountCode}}" stepKey="fillFieldDiscountCode"/>
1717
<click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="clickToApplyDiscount"/>
1818
<waitForElementVisible selector="{{DiscountSection.DiscountVerificationMsg}}" time="30" stepKey="waitForDiscountToBeAdded"/>

0 commit comments

Comments
 (0)