Skip to content

Commit 0845f00

Browse files
Merge branch 'MAGETWO-96431' of https://github.com/magento-epam/magento2ce into MAGETWO-96431
2 parents fb9e645 + dd7dcaf commit 0845f00

File tree

12 files changed

+146
-5
lines changed

12 files changed

+146
-5
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,7 @@
302302
<argument name="website"/>
303303
<argument name="product"/>
304304
</arguments>
305-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="navigateToProductPage"/>
306-
<waitForPageLoad stepKey="waitForProductsList"/>
307-
<click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.name)}}"/>
305+
<click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/>
308306
<waitForPageLoad stepKey="waitForProductPage"/>
309307
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/>
310308
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
5353
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
5454

55+
<!-- Reset Product filter -->
56+
57+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
58+
5559
<!-- Delete Store View EN -->
5660

5761
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1">

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<!-- Go to checkout from minicart -->
1818
<actionGroup name="GoToCheckoutFromMinicartActionGroup">
1919
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity" />
20+
<wait time="5" stepKey="waitMinicartRendering"/>
2021
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
2122
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
2223
</actionGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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="StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest">
11+
<annotations>
12+
<title value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
13+
<stories value="Checkout Free Shipping Recalculation after Coupon Code Added"/>
14+
<description value="User should be able to do checkout free shipping recalculation after adding coupon code"/>
15+
<features value="Checkout"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-96537"/>
18+
<useCaseId value="MAGETWO-96431"/>
19+
<group value="Checkout"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer">
25+
<field key="group_id">1</field>
26+
</createData>
27+
<createData entity="_defaultCategory" stepKey="defaultCategory"/>
28+
<createData entity="_defaultProduct" stepKey="simpleProduct">
29+
<field key="price">90</field>
30+
<requiredEntity createDataKey="defaultCategory"/>
31+
</createData>
32+
<!--It is default for FlatRate-->
33+
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
34+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/>
35+
<createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/>
36+
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
37+
<actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createCartPriceRule">
38+
<argument name="ruleName" value="CatPriceRule"/>
39+
<argument name="couponCode" value="CatPriceRule.coupon_code"/>
40+
</actionGroup>
41+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront">
42+
<argument name="Customer" value="$$createSimpleUsCustomer$$"/>
43+
</actionGroup>
44+
<amOnPage url="$$simpleProduct.name$$.html" stepKey="navigateToProductPage"/>
45+
<waitForPageLoad stepKey="waitForProductPage"/>
46+
</before>
47+
<after>
48+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
49+
<deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/>
50+
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
51+
<createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/>
52+
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
53+
<magentoCLI command="cache:flush" stepKey="flushCache2"/>
54+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule">
55+
<argument name="ruleName" value="{{CatPriceRule.name}}"/>
56+
</actionGroup>
57+
<actionGroup ref="logout" stepKey="logout"/>
58+
</after>
59+
60+
<actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule">
61+
<argument name="product" value="$$simpleProduct$$"/>
62+
<argument name="couponCode" value="{{CatPriceRule.coupon_code}}"/>
63+
</actionGroup>
64+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/>
65+
<waitForPageLoad stepKey="waitForpageLoad1"/>
66+
<dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/>
67+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage"/>
68+
<waitForPageLoad stepKey="waitForShoppingCartPage"/>
69+
<conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickIfDiscountTabClosed1"/>
70+
<waitForPageLoad stepKey="waitForCouponTabOpen1"/>
71+
<click selector="{{DiscountSection.CancelCoupon}}" stepKey="cancelCoupon"/>
72+
<waitForPageLoad stepKey="waitForCancel"/>
73+
<see userInput='You canceled the coupon code.' stepKey="seeCancellationMessage"/>
74+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart2"/>
75+
<waitForPageLoad stepKey="waitForShippingMethods"/>
76+
<click stepKey="chooseFreeShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}"/>
77+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext1"/>
78+
<waitForPageLoad stepKey="waitForReviewAndPayments1"/>
79+
<conditionalClick selector="{{DiscountSection.DiscountTab}}" dependentSelector="{{DiscountSection.CouponInput}}" visible="false" stepKey="clickIfDiscountTabClosed2"/>
80+
<waitForPageLoad stepKey="waitForCouponTabOpen2"/>
81+
<fillField selector="{{DiscountSection.DiscountInput}}" userInput="{{CatPriceRule.coupon_code}}" stepKey="fillCouponCode"/>
82+
<click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="applyCode"/>
83+
<waitForPageLoad stepKey="waitForPageLoad"/>
84+
<see userInput="Your coupon was successfully applied." stepKey="seeSuccessMessage"/>
85+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder1"/>
86+
<waitForPageLoad stepKey="waitForError"/>
87+
<see stepKey="seeShippingMethodError" userInput="The shipping method is missing. Select the shipping method and try again."/>
88+
<amOnPage stepKey="navigateToShippingPage" url="{{CheckoutShippingPage.url}}"/>
89+
<waitForPageLoad stepKey="waitForShippingPageLoad"/>
90+
<click stepKey="chooseFlatRateShipping" selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Flat Rate')}}"/>
91+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext2"/>
92+
<waitForPageLoad stepKey="waitForReviewAndPayments2"/>
93+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder2"/>
94+
<waitForPageLoad stepKey="waitForSuccessfullyPlacedOrder"/>
95+
<see stepKey="seeSuccessMessageForPlacedOrder" userInput="Thank you for your purchase!"/>
96+
</test>
97+
</tests>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,7 @@
9494
<argument name="sku" value="$$createConfigProduct.sku$$"/>
9595
</actionGroup>
9696
<see selector="{{AdminProductGridSection.productGridCell('1', 'Quantity')}}" userInput="99" stepKey="seeProductSkuInGrid"/>
97+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/>
98+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
9799
</test>
98100
</tests>

app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
4848
<argument name="websiteName" value="Second"/>
4949
</actionGroup>
50+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
51+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
5052
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
5153
</after>
5254

app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function collectRates(RateRequest $request)
8080

8181
$this->_updateFreeMethodQuote($request);
8282

83-
if ($request->getFreeShipping() || $request->getBaseSubtotalInclTax() >= $this->getConfigData(
83+
if ($request->getFreeShipping() || $request->getPackageValueWithDiscount() >= $this->getConfigData(
8484
'free_shipping_subtotal'
8585
)
8686
) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
44
* Copyright © Magento, Inc. All rights reserved.
@@ -89,5 +89,6 @@
8989
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
9090
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/>
9191
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Second Website" stepKey="selectWebsites"/>
92+
9293
</actionGroup>
9394
</actionGroups>

app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@
8989
<data key="apply">Percent of product price discount</data>
9090
<data key="discountAmount">50</data>
9191
</entity>
92+
<entity name="CatPriceRule" type="SalesRule">
93+
<data key="name" unique="suffix">CartPriceRule</data>
94+
<data key="websites">Main Website</data>
95+
<data key="customerGroups">'NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'</data>
96+
<data key="coupon_type">Specific Coupon</data>
97+
<data key="coupon_code" unique="suffix">CouponCode</data>
98+
<data key="apply">Percent of product price discount</data>
99+
<data key="discountAmount">10</data>
100+
</entity>
101+
92102
<entity name="SalesRuleSpecificCoupon" type="SalesRule">
93103
<data key="name" unique="suffix">SimpleSalesRule</data>
94104
<data key="description">Sales Rule Description</data>

app/code/Magento/SalesRule/Test/Mftf/Section/DiscountSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="CouponInput" type="input" selector="#coupon_code"/>
1313
<element name="DiscountInput" type="input" selector="#discount-code"/>
1414
<element name="ApplyCodeBtn" type="button" selector="//span[text()='Apply Discount']"/>
15+
<element name="CancelCoupon" type="button" selector="//button[@value='Cancel Coupon']"/>
1516
</section>
1617
</sections>

0 commit comments

Comments
 (0)