Skip to content

Commit 3adfca7

Browse files
committed
MC-19050: [Test Failed]: Magento\FunctionalTestingFramework.functional.AdminReorderWithCatalogPriceTest
1 parent 3ae1e3e commit 3adfca7

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
</arguments>
1616
<!-- Go to the admin Catalog rule grid and add a new one -->
1717
<amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/>
18-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
18+
<waitForPageLoad time="30" stepKey="waitForPageFullyLoaded"/>
1919
<click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/>
20-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
2120

2221
<!-- Fill the form according the attributes of the entity -->
22+
<waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitRuleNameFieldAppears"/>
2323
<fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
2424
<fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
2525
<selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/>
2626
<selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/>
2727

28-
<click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/>
28+
<scrollTo selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" stepKey="scrollToActionsSection"/>
29+
<conditionalClick selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" dependentSelector="{{AdminCatalogPriceRuleSection.actionsTabBody}}" visible="false" stepKey="openActionsTabIfCollapsed"/>
2930
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/>
3031
<fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/>
3132
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/>
3233

3334
<!-- Scroll to top and either save or save and apply after the action group -->
3435
<scrollToTopOfPage stepKey="scrollToTop"/>
3536
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
36-
<waitForPageLoad stepKey="waitForRuleSaved"/>
37-
<see userInput="You saved the rule." stepKey="verifyRuleSaved"/>
37+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
38+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="checkSuccessMessage"/>
3839
</actionGroup>
3940

4041
<actionGroup name="RemoveCatalogPriceRule">
@@ -48,13 +49,12 @@
4849
<fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/>
4950
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
5051
<click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/>
51-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
52-
52+
<waitForPageLoad stepKey="waitForEditRuleFormLoad"/>
53+
<waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitDeleteButtonAppears"/>
5354
<click selector="{{AdminMainActionsSection.delete}}" stepKey="clickToDelete"/>
5455
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForElementVisible"/>
5556
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickToConfirm"/>
5657
<waitForPageLoad stepKey="waitForPageLoad"/>
57-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
5858
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/>
5959
<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="checkSuccessMessage"/>
6060
</actionGroup>

app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,16 @@
4747
<data key="simple_action">to_percent</data>
4848
<data key="discount_amount">90</data>
4949
</entity>
50+
<entity name="CatalogRuleToPercent90" type="catalogRule">
51+
<data key="name" unique="suffix">CatalogPriceRule</data>
52+
<data key="description">Catalog Price Rule Description</data>
53+
<array key="groups">
54+
<item>NOT LOGGED IN</item>
55+
</array>
56+
<array key="websites">
57+
<item>Main Website</item>
58+
</array>
59+
<data key="simple_action">Adjust final price to this percentage</data>
60+
<data key="discount_amount">90</data>
61+
</entity>
5062
</entities>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
<element name="priority" type="input" selector="[name='sort_order']"/>
2828
<element name="conditionsTab" type="block" selector="[data-index='block_promo_catalog_edit_tab_conditions']"/>
2929
<element name="actionsTab" type="block" selector="[data-index='actions']"/>
30+
<element name="actionsTabTitle" type="block" selector="[data-index='actions'] .fieldset-wrapper-title"/>
31+
<element name="actionsTabBody" type="block" selector="[data-index='actions'] .admin__fieldset-wrapper-content"/>
3032
</section>
3133
</sections>

app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@
4444
<after>
4545
<deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/>
4646
<!-- Delete the rule -->
47-
<actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule">
48-
<argument name="ruleName" value="CatalogRuleToPercent.name" />
49-
</actionGroup>
47+
<actionGroup ref="deleteAllCatalogPriceRule" stepKey="removeAllExistingCartPriceRules"/>
5048

5149
<!--Clear all filters in grid-->
52-
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetCatalogRuleGridFilters"/>
5350
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
5451
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
5552
<actionGroup ref="logout" stepKey="logout"/>

0 commit comments

Comments
 (0)