Skip to content

Commit 0615cb6

Browse files
authored
Merge pull request #91 from magento-pangolin/MC-4789
2 parents 9938fbf + 2ecc0ee commit 0615cb6

16 files changed

+725
-82
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

+13
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,19 @@
10261026
<data key="tax_class_id">2</data>
10271027
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
10281028
</entity>
1029+
<entity name="defaultSimpleProductWeight200" type="product">
1030+
<data key="name" unique="suffix">Testp</data>
1031+
<data key="sku" unique="suffix">testsku</data>
1032+
<data key="type_id">simple</data>
1033+
<data key="attribute_set_id">4</data>
1034+
<data key="visibility">4</data>
1035+
<data key="price">560.00</data>
1036+
<data key="urlKey" unique="suffix">testurl-</data>
1037+
<data key="status">1</data>
1038+
<data key="quantity">25</data>
1039+
<data key="weight">200</data>
1040+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
1041+
</entity>
10291042
<entity name="SimpleProductWithTwoOption" type="product">
10301043
<var key="sku" entityType="product" entityKey="sku" />
10311044
<requiredEntity type="product_option">ProductOptionMultiSelect</requiredEntity>

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup">
1111
<arguments>
12-
<argument name="ruleName" type="entity"/>
12+
<argument name="rule" type="entity"/>
1313
</arguments>
1414
<conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.actionsHeader}}" visible="true" stepKey="clickToExpandActions"/>
15-
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{ruleName.simple_action}}" stepKey="selectActionType"/>
16-
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{ruleName.discount_amount}}" stepKey="fillDiscountAmount"/>
17-
<fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{ruleName.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/>
18-
<fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{ruleName.discount_step}}" stepKey="fillDiscountStep"/>
15+
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{rule.simple_action}}" stepKey="selectActionType"/>
16+
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{rule.discount_amount}}" stepKey="fillDiscountAmount"/>
17+
<fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{rule.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/>
18+
<fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{rule.discount_step}}" stepKey="fillDiscountStep"/>
1919
</actionGroup>
2020
<actionGroup name="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup">
2121
<click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/>
@@ -25,8 +25,8 @@
2525
</actionGroup>
2626
<actionGroup name="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup">
2727
<arguments>
28-
<argument name="ruleName" type="string"/>
28+
<argument name="freeShippingOption" type="string"/>
2929
</arguments>
30-
<selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName}}" stepKey="selectForMatchingItemsOnly"/>
30+
<selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/>
3131
</actionGroup>
32-
</actionGroups>
32+
</actionGroups>

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

-46
This file was deleted.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="AdminCreateCartPriceRuleLabelsSectionActionGroup">
1111
<arguments>
12-
<argument name="ruleName" type="entity"/>
12+
<argument name="rule" type="entity"/>
1313
</arguments>
1414
<conditionalClick selector="{{AdminCartPriceRulesFormSection.labelsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.labelsHeader}}" visible="true" stepKey="clickToExpandLabels"/>
15-
<fillField selector="{{AdminCartPriceRulesFormSection.defaultRuleLabelAllStoreViews}}" userInput="{{ruleName.defaultRuleLabelAllStoreViews}}" stepKey="fillDefaultRuleLabelAllStoreViews"/>
16-
<fillField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{ruleName.defaultStoreView}}" stepKey="fillDefaultStoreView"/>
15+
<fillField selector="{{AdminCartPriceRulesFormSection.defaultRuleLabelAllStoreViews}}" userInput="{{rule.defaultRuleLabelAllStoreViews}}" stepKey="fillDefaultRuleLabelAllStoreViews"/>
16+
<fillField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{rule.defaultStoreView}}" stepKey="fillDefaultStoreView"/>
1717
</actionGroup>
18-
</actionGroups>
18+
</actionGroups>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
1212
<see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeAssertSuccessSaveMessage"/>
1313
</actionGroup>
14-
</actionGroups>
14+
</actionGroups>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
<seeElement selector="{{StorefrontMinicartSection.productImage}}" stepKey="seeProductImage"/>
2222
<see selector="{{StorefrontMinicartSection.productSubTotal}}" userInput="{{cartSubtotal}}" stepKey="seeSubTotal"/>
2323
</actionGroup>
24-
</actionGroups>
24+
</actionGroups>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
1414
<waitForPageLoad stepKey="waitForPageToLoad"/>
1515
</actionGroup>
16-
</actionGroups>
16+
</actionGroups>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
1414
<waitForPageLoad stepKey="waitForPageToLoad"/>
1515
</actionGroup>
16-
</actionGroups>
16+
</actionGroups>

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

+84-3
Original file line numberDiff line numberDiff line change
@@ -241,20 +241,101 @@
241241
<data key="apply">Percent of product price discount</data>
242242
<data key="discountAmount">50</data>
243243
</entity>
244-
244+
<entity name="CartPriceRuleConditionAndFreeShippingApplied">
245+
<data key="name" unique="suffix">Cart Price Rule For RuleCondition And FreeShipping</data>
246+
<data key="description">Description for Cart Price Rule</data>
247+
<data key="is_active">Yes</data>
248+
<data key="websites">Main Website</data>
249+
<data key="customerGroups">NOT LOGGED IN</data>
250+
<data key="coupon_type">No Coupon</data>
251+
<data key="simple_action">Percent of product price discount</data>
252+
<data key="discount_amount">50</data>
253+
<data key="maximumQtyDiscount">0</data>
254+
<data key="discount_step">0</data>
255+
<data key="apply_to_shipping">0</data>
256+
<data key="simple_free_shipping">For matching items only</data>
257+
<data key="defaultRuleLabelAllStoreViews">Free Shipping in conditions</data>
258+
<data key="defaultStoreView">Free Shipping in conditions</data>
259+
</entity>
260+
<entity name="CartPriceRuleConditionAppliedForSubtotal">
261+
<data key="name" unique="suffix">Cart Price Rule For Rule Condition</data>
262+
<data key="description">Description for Cart Price Rule</data>
263+
<data key="is_active">Yes</data>
264+
<data key="websites">Main Website</data>
265+
<data key="customerGroups">NOT LOGGED IN</data>
266+
<data key="coupon_type">No Coupon</data>
267+
<data key="subtotal">560</data>
268+
<data key="simple_action">Percent of product price discount</data>
269+
<data key="discount_amount">50</data>
270+
<data key="maximumQtyDiscount">0</data>
271+
<data key="discount_step">0</data>
272+
<data key="apply_to_shipping">0</data>
273+
<data key="simple_free_shipping">No</data>
274+
<data key="defaultRuleLabelAllStoreViews">Free Shipping in Rule conditions</data>
275+
<data key="defaultStoreView">Free Shipping in Rule conditions</data>
276+
</entity>
277+
<entity name="CartPriceRuleConditionNotApplied">
278+
<data key="name" unique="suffix">Cart Price Rule Condition Not Applied</data>
279+
<data key="description">Description for Cart Price Rule</data>
280+
<data key="is_active">Yes</data>
281+
<data key="websites">Main Website</data>
282+
<data key="customerGroups">NOT LOGGED IN</data>
283+
<data key="coupon_type">No Coupon</data>
284+
<data key="totalItemQuantity">3</data>
285+
<data key="simple_action">Percent of product price discount</data>
286+
<data key="discount_amount">50</data>
287+
<data key="maximumQtyDiscount">0</data>
288+
<data key="discount_step">0</data>
289+
<data key="apply_to_shipping">0</data>
290+
<data key="simple_free_shipping">No</data>
291+
<data key="defaultRuleLabelAllStoreViews">Total Items Quantity-Not Applied test</data>
292+
<data key="defaultStoreView">Total Items Quantity-Not Applied test</data>
293+
</entity>
294+
<entity name="CartPriceRuleConditionAppliedForWeight">
295+
<data key="name" unique="suffix">Cart Price Rule With Weight Condition Applied</data>
296+
<data key="description">Description for Cart Price Rule</data>
297+
<data key="is_active">Yes</data>
298+
<data key="websites">Main Website</data>
299+
<data key="customerGroups">NOT LOGGED IN</data>
300+
<data key="coupon_type">No Coupon</data>
301+
<data key="totalWeight">200</data>
302+
<data key="simple_action">Percent of product price discount</data>
303+
<data key="discount_amount">50</data>
304+
<data key="maximumQtyDiscount">0</data>
305+
<data key="discount_step">0</data>
306+
<data key="apply_to_shipping">0</data>
307+
<data key="simple_free_shipping">No</data>
308+
<data key="defaultRuleLabelAllStoreViews">Total Weight is 200</data>
309+
<data key="defaultStoreView">Total Weight is 200</data>
310+
</entity>
311+
<entity name="CartPriceRuleConditionAppliedForCategory">
312+
<data key="name" unique="suffix">Cart Price Rule With Category Condition Applied</data>
313+
<data key="description">Description for Cart Price Rule</data>
314+
<data key="is_active">Yes</data>
315+
<data key="websites">Main Website</data>
316+
<data key="customerGroups">NOT LOGGED IN</data>
317+
<data key="coupon_type">No Coupon</data>
318+
<data key="simple_action">Percent of product price discount</data>
319+
<data key="discount_amount">50</data>
320+
<data key="maximumQtyDiscount">0</data>
321+
<data key="discount_step">0</data>
322+
<data key="apply_to_shipping">0</data>
323+
<data key="simple_free_shipping">No</data>
324+
<data key="defaultRuleLabelAllStoreViews">Product attribute combination - Category</data>
325+
<data key="defaultStoreView">Product attribute combination - Category</data>
326+
</entity>
245327
<entity name="RetailerCartPriceRule" type="SalesRule">
246328
<data key="name" unique="suffix">Cart Price Rule</data>
247329
<data key="websites">Main Website</data>
248330
<data key="customerGroups">'Retailer'</data>
249331
<data key="apply">Percent of product price discount</data>
250332
<data key="discountAmount">50</data>
251333
</entity>
252-
253334
<entity name="SegmentCartPriceRule" type="SalesRule">
254335
<data key="name" unique="suffix">Cart Price Rule</data>
255336
<data key="websites">Main Website</data>
256337
<data key="customerGroups">'General'</data>
257338
<data key="apply">Percent of product price discount</data>
258339
<data key="discountAmount">50</data>
259340
</entity>
260-
</entities>
341+
</entities>

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

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
<element name="conditionSelect" type="select" selector="select[name='rule[conditions][1][new_child]']"/>
4747
<element name="targetEllipsis" type="input" selector="//ul[contains(@id, 'conditions')]//a[.='...']"/>
4848
<element name="ruleFieldByIndex" type="input" selector="[id='conditions__{{index}}__value']" parameterized="true"/>
49+
<element name="addNewCondition" type="button" selector="//ul[@id = 'conditions__{{nestedIndex}}__children']/li/span[contains(@class, 'rule-param-new-child')]" parameterized="true" timeout="30"/>
50+
<element name="conditionSelectDropdown" type="select" selector="select[name='rule[conditions][{{nestedIndex}}][new_child]']" parameterized="true"/>
4951
<element name="selectCountryDropdown" type="select" selector="(//*[contains(@value,'country_id')]/..//select)[last()]"/>
5052

5153
<!--Conditions checker -->

0 commit comments

Comments
 (0)