Skip to content

Commit b3804f3

Browse files
author
Alexey Yakimovich
committed
MC-10971: [Magento Cloud] - Unable to Scope Catalog Price rules by custom product attribute
- Fixed mftf test;
1 parent 9f8456b commit b3804f3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
<fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" />
4848
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="selectActive" />
4949
<selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" />
50-
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" parameterArray="{{catalogRule.customer_group_ids}}" stepKey="selectCustomerGroup" />
5150
<click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/>
5251
<fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/>
52+
53+
<scrollToTopOfPage stepKey="scrollToTop"/>
54+
<waitForPageLoad stepKey="waitForApplied"/>
5355
</actionGroup>
5456

5557
<actionGroup name="CreateCatalogPriceRuleConditionWithAttribute">
@@ -109,4 +111,8 @@
109111
<actionGroup name="selectGeneralCustomerGroupActionGroup">
110112
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/>
111113
</actionGroup>
114+
115+
<actionGroup name="selectNotLoggedInCustomerGroupActionGroup">
116+
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/>
117+
</actionGroup>
112118
</actionGroups>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
2323

24-
<createData entity="CatalogRuleWithAllCustomerGroups" stepKey="createCatalogPriceRule"/>
2524
<createData entity="ApiCategory" stepKey="createFirstCategory"/>
2625
<createData entity="ApiSimpleProduct" stepKey="createFirstProduct">
2726
<requiredEntity createDataKey="createFirstCategory"/>
@@ -69,14 +68,17 @@
6968
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
7069
<waitForPageLoad stepKey="waitForPriceRulePage"/>
7170
<actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule">
72-
<argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/>
71+
<argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/>
7372
</actionGroup>
73+
<actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/>
7474
<actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition">
7575
<argument name="attributeName" value="$$createProductAttribute.attribute[frontend_labels][0][label]$$"/>
7676
<argument name="targetValue" value="is"/>
7777
<argument name="targetSelectValue" value="is undefined"/>
7878
</actionGroup>
7979
<click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveRule"/>
80+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
81+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
8082

8183
<!--Check Catalog Price Rule for first product-->
8284
<amOnPage url="{{StorefrontProductPage.url($$createFirstProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToFirstProductPage"/>

0 commit comments

Comments
 (0)