Skip to content

Commit b72c2ce

Browse files
committed
Merge remote-tracking branch 'github-magento/MC-10974-rule' into EPAM-PR-83
2 parents 68c48d5 + 0fa10cd commit b72c2ce

17 files changed

+44
-34
lines changed

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<waitForPageLoad stepKey="waitForPageToLoad"/>
2222
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
2323
<fillField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/>
24-
<selectOption selector="{{AdminNewCatalogPriceRule.status}}" userInput="{{catalogRule.is_active}}" stepKey="selectStatus"/>
2524
<selectOption stepKey="selectWebSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}"/>
2625
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/>
2726
<scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab"/>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
<description>Validates that the provided Catalog Rule, Status, Websites and Customer Group details are present and correct on a Admin Catalog Price Rule creation/edit page.</description>
1414
</annotations>
1515
<arguments>
16-
<argument name="catalogRule" defaultValue="inactiveCatalogRule"/>
16+
<argument name="catalogRule" defaultValue="inactiveCatalogRule" />
1717
<argument name="status" type="string" defaultValue=""/>
1818
<argument name="websites" type="string"/>
1919
<argument name="customerGroup" type="string"/>
2020
</arguments>
2121

2222
<seeInField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
2323
<seeInField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/>
24-
<seeOptionIsSelected selector="{{AdminNewCatalogPriceRule.status}}" userInput="{{status}}" stepKey="selectStatus"/>
2524
<see stepKey="seeWebSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{websites}}"/>
2625
<seeOptionIsSelected selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/>
2726
<scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab"/>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<!-- Fill the form according the attributes of the entity -->
2626
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
2727
<fillField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/>
28+
<click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/>
2829
<selectOption stepKey="selectSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}"/>
2930
<click stepKey="clickFromCalender" selector="{{AdminNewCatalogPriceRule.fromDateButton}}"/>
3031
<click stepKey="clickFromToday" selector="{{AdminNewCatalogPriceRule.todayDate}}"/>
@@ -49,9 +50,10 @@
4950
</arguments>
5051

5152
<click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
52-
<fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
53-
<fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
54-
<selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite"/>
53+
<fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" />
54+
<click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/>
55+
<fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" />
56+
<selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" />
5557
<click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/>
5658
<fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/>
5759
<scrollToTopOfPage stepKey="scrollToTop"/>

app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleStagingSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCatalogPriceRuleStagingSection">
1212
<element name="status" type="select" selector=".modal-component [data-index='is_active'] select"/>
13+
<element name="isActive" type="select" selector=".modals-wrapper input[name='is_active']+label"/>
1314
</section>
1415
</sections>

app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
<element name="ruleNameNew" type="input" selector="[name='staging[name]']"/>
2121
<element name="description" type="textarea" selector="[name='description']"/>
2222
<element name="status" type="select" selector="[name='is_active']"/>
23+
<element name="isActive" type="select" selector="input[name='is_active']+label"/>
2324

2425
<element name="websites" type="select" selector="[name='website_ids']"/>
26+
<element name="active" type="checkbox" selector="//div[contains(@class, 'admin__actions-switch')]/input[@name='is_active']/../label"/>
27+
<element name="activeIsEnabled" type="checkbox" selector="(//div[contains(@class, 'admin__actions-switch')])[1]/input[@value='1']"/>
28+
<element name="activePosition" type="checkbox" selector="fieldset[class='admin__fieldset'] div[class*='_required']:nth-of-type(4)"/>
2529
<element name="websitesOptions" type="select" selector="[name='website_ids'] option"/>
2630
<element name="customerGroups" type="select" selector="[name='customer_group_ids']"/>
2731
<element name="customerGroupsOptions" type="select" selector="[name='customer_group_ids'] option"/>

app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<waitForPageLoad stepKey="waitForIndividualRulePage"/>
5353
<fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{_defaultCatalogRule.name}}" stepKey="fillName"/>
5454
<fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{_defaultCatalogRule.description}}" stepKey="fillDescription"/>
55+
<click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/>
5556
<selectOption selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{_defaultCatalogRule.website_ids[0]}}" stepKey="selectSite"/>
5657
<click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/>
5758
<click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/>

app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
<argument name="websites" value="Main Website"/>
5959
<argument name="customerGroup" value="General"/>
6060
</actionGroup>
61+
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveRule"/>
6162

6263
<!-- Search Catalog Rule in Grid -->
6364
<actionGroup ref="AdminSearchCatalogRuleInGridActionGroup" stepKey="searchCreatedCatalogRule">

app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
Websites: Main Website
196196
Customer Groups: NOT LOGGED IN -->
197197
<fillField userInput="{{SimpleCatalogPriceRule.name}}" selector="{{AdminCartPriceRulesFormSection.ruleName}}" stepKey="fillRuleName"/>
198+
<click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/>
198199
<selectOption userInput="{{SimpleCatalogPriceRule.websites}}" selector="{{AdminCartPriceRulesFormSection.websites}}" stepKey="selectWebsite"/>
199200
<selectOption userInput="{{SimpleCatalogPriceRule.customerGroups}}" selector="{{AdminCartPriceRulesFormSection.customerGroups}}" stepKey="selectCustomerGroups"/>
200201

app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
</createData>
2727
<actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/>
2828
<actionGroup stepKey="selectLoggedInCustomers" ref="selectNotLoggedInCustomerGroup"/>
29-
<selectOption selector="{{AdminNewCatalogPriceRule.status}}" userInput="Inactive" stepKey="setInactive"/>
29+
<scrollToTopOfPage stepKey="scrollToTop"/>
30+
<click stepKey="setInactive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/>
3031
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/>
3132
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="seeSuccess"/>
3233
</before>

app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,30 @@
9595
<dataScope>description</dataScope>
9696
</settings>
9797
</field>
98-
<field name="is_active" formElement="select">
98+
<field name="is_active" formElement="checkbox">
9999
<argument name="data" xsi:type="array">
100100
<item name="config" xsi:type="array">
101101
<item name="source" xsi:type="string">catalog_rule</item>
102+
<item name="default" xsi:type="number">0</item>
102103
</item>
103104
</argument>
104105
<settings>
105-
<dataType>number</dataType>
106-
<label translate="true">Status</label>
107-
<visible>true</visible>
108-
<dataScope>is_active</dataScope>
106+
<validation>
107+
<rule name="required-entry" xsi:type="boolean">true</rule>
108+
</validation>
109+
<dataType>boolean</dataType>
110+
<label translate="true">Active</label>
109111
</settings>
110112
<formElements>
111-
<select>
113+
<checkbox>
112114
<settings>
113-
<options>
114-
<option name="0" xsi:type="array">
115-
<item name="value" xsi:type="number">1</item>
116-
<item name="label" xsi:type="string" translate="true">Active</item>
117-
</option>
118-
<option name="1" xsi:type="array">
119-
<item name="value" xsi:type="number">0</item>
120-
<item name="label" xsi:type="string" translate="true">Inactive</item>
121-
</option>
122-
</options>
115+
<valueMap>
116+
<map name="false" xsi:type="number">0</map>
117+
<map name="true" xsi:type="number">1</map>
118+
</valueMap>
119+
<prefer>toggle</prefer>
123120
</settings>
124-
</select>
121+
</checkbox>
125122
</formElements>
126123
</field>
127124
<field name="website_ids" formElement="multiselect">

0 commit comments

Comments
 (0)