Skip to content

Commit

Permalink
Merge pull request #91 from magento-pangolin/MC-4789
Browse files Browse the repository at this point in the history
  • Loading branch information
tomreece committed Apr 11, 2019
2 parents 9938fbf + 2ecc0ee commit 0615cb6
Show file tree
Hide file tree
Showing 16 changed files with 725 additions and 82 deletions.
13 changes: 13 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,19 @@
<data key="tax_class_id">2</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
</entity>
<entity name="defaultSimpleProductWeight200" type="product">
<data key="name" unique="suffix">Testp</data>
<data key="sku" unique="suffix">testsku</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="price">560.00</data>
<data key="urlKey" unique="suffix">testurl-</data>
<data key="status">1</data>
<data key="quantity">25</data>
<data key="weight">200</data>
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
</entity>
<entity name="SimpleProductWithTwoOption" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionMultiSelect</requiredEntity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup">
<arguments>
<argument name="ruleName" type="entity"/>
<argument name="rule" type="entity"/>
</arguments>
<conditionalClick selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.actionsHeader}}" visible="true" stepKey="clickToExpandActions"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{ruleName.simple_action}}" stepKey="selectActionType"/>
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{ruleName.discount_amount}}" stepKey="fillDiscountAmount"/>
<fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{ruleName.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/>
<fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{ruleName.discount_step}}" stepKey="fillDiscountStep"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{rule.simple_action}}" stepKey="selectActionType"/>
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{rule.discount_amount}}" stepKey="fillDiscountAmount"/>
<fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{rule.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/>
<fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{rule.discount_step}}" stepKey="fillDiscountStep"/>
</actionGroup>
<actionGroup name="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup">
<click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/>
Expand All @@ -25,8 +25,8 @@
</actionGroup>
<actionGroup name="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup">
<arguments>
<argument name="ruleName" type="string"/>
<argument name="freeShippingOption" type="string"/>
</arguments>
<selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName}}" stepKey="selectForMatchingItemsOnly"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/>
</actionGroup>
</actionGroups>
</actionGroups>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateCartPriceRuleLabelsSectionActionGroup">
<arguments>
<argument name="ruleName" type="entity"/>
<argument name="rule" type="entity"/>
</arguments>
<conditionalClick selector="{{AdminCartPriceRulesFormSection.labelsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.labelsHeader}}" visible="true" stepKey="clickToExpandLabels"/>
<fillField selector="{{AdminCartPriceRulesFormSection.defaultRuleLabelAllStoreViews}}" userInput="{{ruleName.defaultRuleLabelAllStoreViews}}" stepKey="fillDefaultRuleLabelAllStoreViews"/>
<fillField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{ruleName.defaultStoreView}}" stepKey="fillDefaultStoreView"/>
<fillField selector="{{AdminCartPriceRulesFormSection.defaultRuleLabelAllStoreViews}}" userInput="{{rule.defaultRuleLabelAllStoreViews}}" stepKey="fillDefaultRuleLabelAllStoreViews"/>
<fillField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{rule.defaultStoreView}}" stepKey="fillDefaultStoreView"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
<see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeAssertSuccessSaveMessage"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<seeElement selector="{{StorefrontMinicartSection.productImage}}" stepKey="seeProductImage"/>
<see selector="{{StorefrontMinicartSection.productSubTotal}}" userInput="{{cartSubtotal}}" stepKey="seeSubTotal"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
</actionGroup>
</actionGroups>
</actionGroups>
87 changes: 84 additions & 3 deletions app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,20 +241,101 @@
<data key="apply">Percent of product price discount</data>
<data key="discountAmount">50</data>
</entity>

<entity name="CartPriceRuleConditionAndFreeShippingApplied">
<data key="name" unique="suffix">Cart Price Rule For RuleCondition And FreeShipping</data>
<data key="description">Description for Cart Price Rule</data>
<data key="is_active">Yes</data>
<data key="websites">Main Website</data>
<data key="customerGroups">NOT LOGGED IN</data>
<data key="coupon_type">No Coupon</data>
<data key="simple_action">Percent of product price discount</data>
<data key="discount_amount">50</data>
<data key="maximumQtyDiscount">0</data>
<data key="discount_step">0</data>
<data key="apply_to_shipping">0</data>
<data key="simple_free_shipping">For matching items only</data>
<data key="defaultRuleLabelAllStoreViews">Free Shipping in conditions</data>
<data key="defaultStoreView">Free Shipping in conditions</data>
</entity>
<entity name="CartPriceRuleConditionAppliedForSubtotal">
<data key="name" unique="suffix">Cart Price Rule For Rule Condition</data>
<data key="description">Description for Cart Price Rule</data>
<data key="is_active">Yes</data>
<data key="websites">Main Website</data>
<data key="customerGroups">NOT LOGGED IN</data>
<data key="coupon_type">No Coupon</data>
<data key="subtotal">560</data>
<data key="simple_action">Percent of product price discount</data>
<data key="discount_amount">50</data>
<data key="maximumQtyDiscount">0</data>
<data key="discount_step">0</data>
<data key="apply_to_shipping">0</data>
<data key="simple_free_shipping">No</data>
<data key="defaultRuleLabelAllStoreViews">Free Shipping in Rule conditions</data>
<data key="defaultStoreView">Free Shipping in Rule conditions</data>
</entity>
<entity name="CartPriceRuleConditionNotApplied">
<data key="name" unique="suffix">Cart Price Rule Condition Not Applied</data>
<data key="description">Description for Cart Price Rule</data>
<data key="is_active">Yes</data>
<data key="websites">Main Website</data>
<data key="customerGroups">NOT LOGGED IN</data>
<data key="coupon_type">No Coupon</data>
<data key="totalItemQuantity">3</data>
<data key="simple_action">Percent of product price discount</data>
<data key="discount_amount">50</data>
<data key="maximumQtyDiscount">0</data>
<data key="discount_step">0</data>
<data key="apply_to_shipping">0</data>
<data key="simple_free_shipping">No</data>
<data key="defaultRuleLabelAllStoreViews">Total Items Quantity-Not Applied test</data>
<data key="defaultStoreView">Total Items Quantity-Not Applied test</data>
</entity>
<entity name="CartPriceRuleConditionAppliedForWeight">
<data key="name" unique="suffix">Cart Price Rule With Weight Condition Applied</data>
<data key="description">Description for Cart Price Rule</data>
<data key="is_active">Yes</data>
<data key="websites">Main Website</data>
<data key="customerGroups">NOT LOGGED IN</data>
<data key="coupon_type">No Coupon</data>
<data key="totalWeight">200</data>
<data key="simple_action">Percent of product price discount</data>
<data key="discount_amount">50</data>
<data key="maximumQtyDiscount">0</data>
<data key="discount_step">0</data>
<data key="apply_to_shipping">0</data>
<data key="simple_free_shipping">No</data>
<data key="defaultRuleLabelAllStoreViews">Total Weight is 200</data>
<data key="defaultStoreView">Total Weight is 200</data>
</entity>
<entity name="CartPriceRuleConditionAppliedForCategory">
<data key="name" unique="suffix">Cart Price Rule With Category Condition Applied</data>
<data key="description">Description for Cart Price Rule</data>
<data key="is_active">Yes</data>
<data key="websites">Main Website</data>
<data key="customerGroups">NOT LOGGED IN</data>
<data key="coupon_type">No Coupon</data>
<data key="simple_action">Percent of product price discount</data>
<data key="discount_amount">50</data>
<data key="maximumQtyDiscount">0</data>
<data key="discount_step">0</data>
<data key="apply_to_shipping">0</data>
<data key="simple_free_shipping">No</data>
<data key="defaultRuleLabelAllStoreViews">Product attribute combination - Category</data>
<data key="defaultStoreView">Product attribute combination - Category</data>
</entity>
<entity name="RetailerCartPriceRule" type="SalesRule">
<data key="name" unique="suffix">Cart Price Rule</data>
<data key="websites">Main Website</data>
<data key="customerGroups">'Retailer'</data>
<data key="apply">Percent of product price discount</data>
<data key="discountAmount">50</data>
</entity>

<entity name="SegmentCartPriceRule" type="SalesRule">
<data key="name" unique="suffix">Cart Price Rule</data>
<data key="websites">Main Website</data>
<data key="customerGroups">'General'</data>
<data key="apply">Percent of product price discount</data>
<data key="discountAmount">50</data>
</entity>
</entities>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<element name="conditionSelect" type="select" selector="select[name='rule[conditions][1][new_child]']"/>
<element name="targetEllipsis" type="input" selector="//ul[contains(@id, 'conditions')]//a[.='...']"/>
<element name="ruleFieldByIndex" type="input" selector="[id='conditions__{{index}}__value']" parameterized="true"/>
<element name="addNewCondition" type="button" selector="//ul[@id = 'conditions__{{nestedIndex}}__children']/li/span[contains(@class, 'rule-param-new-child')]" parameterized="true" timeout="30"/>
<element name="conditionSelectDropdown" type="select" selector="select[name='rule[conditions][{{nestedIndex}}][new_child]']" parameterized="true"/>
<element name="selectCountryDropdown" type="select" selector="(//*[contains(@value,'country_id')]/..//select)[last()]"/>

<!--Conditions checker -->
Expand Down
Loading

0 comments on commit 0615cb6

Please sign in to comment.