Skip to content

Commit bf95fdd

Browse files
committed
PB-48: The order of product SKU is not respected if combined with category condition
1 parent 79b2a74 commit bf95fdd

File tree

2 files changed

+64
-59
lines changed

2 files changed

+64
-59
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckProductsOrderActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
<description>Goes to the Storefront. Validates that the 2 provided Products appear in the correct order.</description>
1414
</annotations>
1515
<arguments>
16+
<argument name="page"/>
1617
<argument name="product_1"/>
1718
<argument name="product_2"/>
1819
</arguments>
1920

20-
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
21+
<amOnPage url="{{page}}" stepKey="goToStoreFrontPage"/>
2122
<waitForPageLoad stepKey="waitForPageLoad5"/>
2223
<grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByNumber('1')}}" userInput="alt" stepKey="grabFirstProductName1_1"/>
2324
<assertEquals expected="{{product_1.name}}" actual="($grabFirstProductName1_1)" message="notExpectedOrder" stepKey="compare1"/>

app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -28,76 +28,79 @@
2828
<createData entity="ApiSimpleProduct" stepKey="product1">
2929
<requiredEntity createDataKey="createFirstCategory"/>
3030
</createData>
31-
<amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/>
32-
<waitForPageLoad stepKey="waitEditHomePagePageToLoad"/>
33-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab"/>
34-
<waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand"/>
35-
<click selector="{{CmsNewPagePageActionsSection.showHideEditor}}" stepKey="showHiddenButtons"/>
36-
<seeElement selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="seeWidgetButton"/>
37-
<click selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="clickInsertWidgetButton"/>
38-
<waitForPageLoad stepKey="waitForPageLoad1"/>
39-
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage"/>
40-
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget"
41-
stepKey="seeInsertWidgetDisabled"/>
42-
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled"/>
43-
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog Products List"
44-
stepKey="selectCatalogProductsList"/>
45-
<waitForPageLoad stepKey="waitBeforeClickingOnAddParamBtn"/>
46-
<click selector="{{WidgetSection.AddParam}}" stepKey="clickAddParamBtn"/>
47-
<waitForElement selector="{{WidgetSection.ConditionsDropdown}}" stepKey="addingWaitForConditionsDropDown"/>
48-
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}" stepKey="waitForDropdownVisible"/>
49-
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="SKU"
50-
stepKey="selectCategoryCondition"/>
51-
<waitForPageLoad stepKey="waitBeforeClickingOnRuleParam"/>
52-
<click selector="{{WidgetSection.RuleParam1('3')}}" stepKey="clickOnRuleParam1"/>
53-
<waitForElementVisible selector="{{WidgetSection.RuleParamSelect('1','1')}}"
54-
stepKey="waitDropdownToAppear"/>
55-
<selectOption selector="{{WidgetSection.RuleParamSelect('1','1')}}" userInput="is one of"
56-
stepKey="selectOption"/>
57-
<waitForElement selector="{{WidgetSection.RuleParam}}" stepKey="waitForRuleParam"/>
58-
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickOnRuleParam"/>
59-
<waitForElementVisible selector="{{WidgetSection.Chooser}}" stepKey="waitForElement"/>
60-
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser"/>
61-
<waitForPageLoad stepKey="waitForPageToLoad"/>
62-
<fillField selector="{{WidgetSection.ChooserName}}" userInput="$$product1.name$$"
63-
stepKey="fillProduct1Name"/>
64-
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSearchFilter"/>
65-
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="searchFilter"/>
66-
<waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct"/>
67-
<click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1"/>
68-
<click selector="{{AdminWidgetsSection.resetFilter}}" stepKey="resetFilter1"/>
69-
<waitForPageLoad stepKey="waitForPageToLoadBeforeFillingProductName"/>
7031
<createData entity="ApiSimpleProduct" stepKey="product2">
7132
<requiredEntity createDataKey="createFirstCategory"/>
7233
</createData>
73-
<fillField selector="{{WidgetSection.ChooserName}}" userInput="$$product2.name$$"
74-
stepKey="fillProduct2Name"/>
75-
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="clickOnSearch"/>
76-
<waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct2"/>
77-
<click selector="{{WidgetSection.PreCreateProduct('$$product2.name$$')}}" stepKey="selectProduct2"/>
78-
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts"/>
79-
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton"/>
80-
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget"/>
81-
<click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/>
82-
<waitForPageLoad stepKey="waitForSaveComplete"/>
34+
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
8335
</before>
8436
<after>
85-
<actionGroup ref="ClearWidgetsFromCMSContent" stepKey="removeWidgets"/>
8637
<actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/>
8738
<deleteData createDataKey="createFirstCategory" stepKey="deleteCategory"/>
8839
<deleteData createDataKey="product1" stepKey="deleteProduct1"/>
8940
<deleteData createDataKey="product2" stepKey="deleteProduct2"/>
41+
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
9042
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
9143
</after>
44+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
45+
<argument name="CMSPage" value="$$createCMSPage$$"/>
46+
</actionGroup>
47+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab1"/>
48+
<waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand1"/>
49+
<click selector="{{CmsNewPagePageActionsSection.showHideEditor}}" stepKey="showHiddenButtons"/>
50+
<seeElement selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="seeWidgetButton"/>
51+
<click selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="clickInsertWidgetButton"/>
52+
<waitForPageLoad stepKey="waitForPageLoad1"/>
53+
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage"/>
54+
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget"
55+
stepKey="seeInsertWidgetDisabled"/>
56+
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled"/>
57+
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog Products List"
58+
stepKey="selectCatalogProductsList"/>
59+
<waitForPageLoad stepKey="waitBeforeClickingOnAddParamBtn"/>
60+
<click selector="{{WidgetSection.AddParam}}" stepKey="clickAddParamBtn"/>
61+
<waitForElement selector="{{WidgetSection.ConditionsDropdown}}" stepKey="addingWaitForConditionsDropDown"/>
62+
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}" stepKey="waitForDropdownVisible"/>
63+
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="SKU"
64+
stepKey="selectCategoryCondition"/>
65+
<waitForPageLoad stepKey="waitBeforeClickingOnRuleParam"/>
66+
<click selector="{{WidgetSection.RuleParam1('3')}}" stepKey="clickOnRuleParam1"/>
67+
<waitForElementVisible selector="{{WidgetSection.RuleParamSelect('1','1')}}"
68+
stepKey="waitDropdownToAppear"/>
69+
<selectOption selector="{{WidgetSection.RuleParamSelect('1','1')}}" userInput="is one of"
70+
stepKey="selectOption"/>
71+
<waitForElement selector="{{WidgetSection.RuleParam}}" stepKey="waitForRuleParam"/>
72+
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickOnRuleParam"/>
73+
<waitForElementVisible selector="{{WidgetSection.Chooser}}" stepKey="waitForElement"/>
74+
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser"/>
75+
<waitForPageLoad stepKey="waitForPageToLoad"/>
76+
<fillField selector="{{WidgetSection.ChooserName}}" userInput="$$product1.name$$"
77+
stepKey="fillProduct1Name"/>
78+
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSearchFilter1"/>
79+
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="searchFilter1"/>
80+
<waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct"/>
81+
<click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1"/>
82+
<click selector="{{AdminWidgetsSection.resetFilter}}" stepKey="resetFilter1"/>
83+
<waitForPageLoad stepKey="waitForPageToLoadBeforeFillingProductName"/>
84+
<fillField selector="{{WidgetSection.ChooserName}}" userInput="$$product2.name$$"
85+
stepKey="fillProduct2Name"/>
86+
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="clickOnSearch"/>
87+
<waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct2"/>
88+
<click selector="{{WidgetSection.PreCreateProduct('$$product2.name$$')}}" stepKey="selectProduct2"/>
89+
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts"/>
90+
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton"/>
91+
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget1"/>
92+
<click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget"/>
93+
<waitForPageLoad stepKey="waitForSaveComplete"/>
9294
<actionGroup ref="CompareTwoProductsOrder" stepKey="compareProductOrders1">
95+
<argument name="page" value="$$createCMSPage.identifier$$"/>
9396
<argument name="product_1" value="$$product1$$"/>
9497
<argument name="product_2" value="$$product2$$"/>
9598
</actionGroup>
96-
97-
<amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/>
98-
<waitForPageLoad stepKey="waitEditHomePagePageToLoad"/>
99-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab"/>
100-
<waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand"/>
99+
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage2">
100+
<argument name="CMSPage" value="$$createCMSPage$$"/>
101+
</actionGroup>
102+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab2"/>
103+
<waitForElementNotVisible selector="{{CmsWYSIWYGSection.CheckIfTabExpand}}" stepKey="waitForTabExpand2"/>
101104
<executeJS function="jQuery('[id=\'cms_page_form_content_ifr\']').attr('name', 'preview-iframe')"
102105
stepKey="setPreviewFrameName"/>
103106
<switchToIFrame selector="preview-iframe" stepKey="switchToIframe"/>
@@ -109,18 +112,19 @@
109112
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser2"/>
110113
<waitForPageLoad stepKey="waitForPageToLoadBeforeFillingProduct1Name"/>
111114
<fillField selector="{{WidgetSection.ChooserName}}" userInput="$$product1.name$$" stepKey="fillProduct1Name_2"/>
112-
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSearchFilter"/>
113-
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="searchFilter"/>
115+
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSearchFilter2"/>
116+
<click selector="{{AdminNewWidgetSection.searchBlock}}" stepKey="searchFilter2"/>
114117
<waitForPageLoad stepKey="waitForPageToLoadBeforeSelectingProduct1"/>
115118
<click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct1_1"/>
116119
<click selector="{{WidgetSection.PreCreateProduct('$$product1.name$$')}}" stepKey="selectProduct2_2"/>
117120
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="applyProducts1"/>
118121
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickOnInsertWidgetButton1"/>
119-
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget"/>
122+
<waitForPageLoad stepKey="waitForPageToLoadBeforeClickingOnSaveWidget2"/>
120123
<click selector="{{InsertWidgetSection.save}}" stepKey="saveWidget1"/>
121124
<waitForPageLoad stepKey="waitForSaveComplete1"/>
122125

123126
<actionGroup ref="CompareTwoProductsOrder" stepKey="compareProductOrders2">
127+
<argument name="page" value="$$createCMSPage.identifier$$"/>
124128
<argument name="product_1" value="$$product2$$"/>
125129
<argument name="product_2" value="$$product1$$"/>
126130
</actionGroup>

0 commit comments

Comments
 (0)