Skip to content

Commit 992e97f

Browse files
committed
Merge remote-tracking branch 'origin/BUG#AC-2242' into AC-2242
2 parents dd0ead3 + 7274fc7 commit 992e97f

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

app/code/Magento/OfflineShipping/etc/db_schema.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
</constraint>
3939
</table>
4040
<table name="salesrule" resource="default" comment="Salesrule">
41-
<column xsi:type="smallint" name="simple_free_shipping" unsigned="true" nullable="false"
42-
identity="false" default="0" comment="Simple Free Shipping"/>
41+
<column xsi:type="smallint" name="simple_free_shipping" unsigned="true" nullable="true"
42+
identity="false" default="null" comment="Simple Free Shipping"/>
4343
</table>
4444
<table name="sales_order_item" resource="sales" comment="Sales Flat Order Item">
4545
<column xsi:type="smallint" name="free_shipping" unsigned="true" nullable="false" identity="false"

app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function execute()
6464
{
6565
$data = $this->getRequest()->getPostValue();
6666
if ($data) {
67+
if ($data['simple_free_shipping'] === '') {
68+
$data['simple_free_shipping'] = null;
69+
}
6770
try {
6871
/** @var $model \Magento\SalesRule\Model\Rule */
6972
$model = $this->_objectManager->create(\Magento\SalesRule\Model\Rule::class);
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="SimplefreeshippingoptionsTest">
11+
<annotations>
12+
<features value="SalesRule"/>
13+
<stories value="Creating Sales Rule"/>
14+
<title value="Test the simple free shipping options as default it should select Please select option"/>
15+
<description value="Test the simple free shipping options as default it should select Please select option "/>
16+
<severity value="MAJOR"/>
17+
<group value="SalesRule"/>
18+
</annotations>
19+
<before>
20+
<!-- Login to admin panel -->
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<!--navigate to cart price rule -->
23+
</before>
24+
25+
<after>
26+
<!-- Delete sales rule -->
27+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="cleanUpRule">
28+
<argument name="ruleName" value="Cart Price Rule"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromBackend"/>
31+
</after>
32+
33+
<!--Create cart price rule as per data and verify Free shipping options-->
34+
<actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="amOnCartPriceList"/>
35+
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
36+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.name}}" stepKey="fillRuleName"/>
37+
<fillField selector="{{AdminCartPriceRulesFormSection.description}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.description}}" stepKey="fillDescription"/>
38+
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.websites}}" stepKey="selectWebsites"/>
39+
40+
<click selector="{{AdminCartPriceRulesFormSection.customerGroups}}" stepKey="expandCustomerGroups" after="selectWebsites"/>
41+
<click selector="{{AdminCartPriceRulesFormSection.customerGroupsSelectAll}}" stepKey="clickSelectAll" after="expandCustomerGroups"/>
42+
<click selector="{{AdminCartPriceRulesFormSection.customerGroupsDoneBtn}}" stepKey="clickDone" after="clickSelectAll"/>
43+
44+
<selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.coupon_type}}" stepKey="selectCouponType"/>
45+
<scrollTo selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="scrollToActionsHeader"/>
46+
<actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="createActiveCartPriceRuleActionsSection">
47+
<argument name="rule" value="CartPriceRuleConditionAndFreeShippingApplied"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminCreateCartPriceRuleLabelsSectionActionGroup" stepKey="createActiveCartPriceRuleLabelsSection">
50+
<argument name="rule" value="CartPriceRuleConditionAndFreeShippingApplied"/>
51+
</actionGroup>
52+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="seeAssertCartPriceRuleSuccessSaveMessage"/>
53+
54+
<!--Search created cart price rule in grid-->
55+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="searchCreatedCartPriceRuleInGrid">
56+
<argument name="ruleName" value="CartPriceRuleConditionAndFreeShippingApplied.name"/>
57+
</actionGroup>
58+
59+
<!--Go to cart price rule form page and verify Free shipping options-->
60+
<conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.actionsHeader}}" visible="true" stepKey="clickExpandActions"/>
61+
<see selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.simple_action}}" stepKey="seeActionApplyType"/>
62+
<seeInField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.discount_amount}}" stepKey="seeDiscountAmount"/>
63+
<selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="Please Select" stepKey="selectFreeShippingType"/>
64+
</test>
65+
</tests>

0 commit comments

Comments
 (0)