Skip to content

Commit a49f7b2

Browse files
committed
Merge remote-tracking branch 'origin/AC-2242' into spartans_2_4_6_quality_backlog
2 parents 64d121c + b900503 commit a49f7b2

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-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+
$data['simple_free_shipping'] = ($data['simple_free_shipping'] === '')
68+
? null : $data['simple_free_shipping'];
69+
6770
try {
6871
/** @var $model \Magento\SalesRule\Model\Rule */
6972
$model = $this->_objectManager->create(\Magento\SalesRule\Model\Rule::class);
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
20+
<before>
21+
<!-- Login to admin panel -->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
<!--navigate to cart price rule -->
24+
</before>
25+
26+
<after>
27+
<!-- Delete sales rule -->
28+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="cleanUpRule">
29+
<argument name="ruleName" value="Cart Price Rule"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromBackend"/>
32+
</after>
33+
34+
<!--Create cart price rule as per data and verify Free shipping options-->
35+
<actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="amOnCartPriceList"/>
36+
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
37+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.name}}" stepKey="fillRuleName"/>
38+
<fillField selector="{{AdminCartPriceRulesFormSection.description}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.description}}" stepKey="fillDescription"/>
39+
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.websites}}" stepKey="selectWebsites"/>
40+
<actionGroup ref="SelectRetailerCustomerGroupActionGroup" stepKey="selectRetailerCustomerGroup"/>
41+
<selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.coupon_type}}" stepKey="selectCouponType"/>
42+
<scrollTo selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="scrollToActionsHeader"/>
43+
<actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="createActiveCartPriceRuleActionsSection">
44+
<argument name="rule" value="CartPriceRuleConditionAndFreeShippingApplied"/>
45+
</actionGroup>
46+
<actionGroup ref="AdminCreateCartPriceRuleLabelsSectionActionGroup" stepKey="createActiveCartPriceRuleLabelsSection">
47+
<argument name="rule" value="CartPriceRuleConditionAndFreeShippingApplied"/>
48+
</actionGroup>
49+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="seeAssertCartPriceRuleSuccessSaveMessage"/>
50+
51+
<!--Search created cart price rule in grid-->
52+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="searchCreatedCartPriceRuleInGrid">
53+
<argument name="ruleName" value="CartPriceRuleConditionAndFreeShippingApplied.name"/>
54+
</actionGroup>
55+
56+
<!--Go to cart price rule form page and verify Free shipping options-->
57+
<conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.actionsHeader}}" visible="true" stepKey="clickExpandActions"/>
58+
<see selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.simple_action}}" stepKey="seeActionApplyType"/>
59+
<seeInField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.discount_amount}}" stepKey="seeDiscountAmount"/>
60+
<seeOptionIsSelected selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="Please Select" stepKey="selectFreeShippingType"/>
61+
</test>
62+
</tests>

0 commit comments

Comments
 (0)