Skip to content

Commit 719c206

Browse files
committed
MC-38787: Admin Product Grid Page indicator issue
1 parent fd2c270 commit 719c206

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberSetsToOneAfterNewSearchTest.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<annotations>
1414
<features value="Catalog"/>
1515
<stories value="Catalog grid"/>
16-
<title value="Checking Catalog grid page number after entering a new search keyword"/>
17-
<description value="Checking Catalog grid page number after entering a new search keyword"/>
18-
<severity value="MINOR"/>
19-
<testCaseId value="MC-xxxxx"/>
16+
<title value="Updating the search keyword in admin product grid should reset current page to the first one"/>
17+
<description value="When changing the search keyword in admin product grid, new results should be displayed from the page one"/>
18+
<severity value="AVERAGE"/>
19+
<testCaseId value="MC-39332"/>
2020
<useCaseId value="MC-38787"/>
2121
<group value="Catalog"/>
2222
</annotations>
@@ -82,14 +82,16 @@
8282
<argument name="keyword" value="SimpleProduct"/>
8383
</actionGroup>
8484

85+
<waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('4')}}" stepKey="seeTotalPagesIsFourOnFirstSearch"/>
8586
<comment userInput="Go to the next page" stepKey="nextPage"/>
8687
<click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageProductGrid"/>
87-
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGrid"/>
88+
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageProductGridOnFirstSearch"/>
8889

8990
<actionGroup ref="SearchProductGridByStringNoClearActionGroup" stepKey="searchForVirtualProduct">
9091
<argument name="keyword" value="VirtualProduct"/>
9192
</actionGroup>
9293

93-
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGrid"/>
94+
<waitForElementVisible selector="{{AdminDataGridPaginationSection.totalPagesCount('3')}}" stepKey="seeTotalPagesIsThreeOnSecondSearch"/>
95+
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="1" stepKey="seeOnFirstPageProductGridOnSecondSearch"/>
9496
</test>
9597
</tests>

app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridPaginationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<element name="previousPage" type="button" selector="div.admin__data-grid-pager > button.action-previous" timeout="30"/>
2121
<element name="currentPage" type="input" selector="div.admin__data-grid-pager > input[data-ui-id='current-page-input']"/>
2222
<element name="totalPages" type="text" selector="div.admin__data-grid-pager > label"/>
23+
<element name="totalPagesCount" type="text" selector="//div[@class='admin__data-grid-pager']//label[@class='admin__control-support-text' and .='of {{arg1}}']" parameterized="true"/>
2324
<element name="perPageDropDownValue" type="input" selector=".selectmenu-value input" timeout="30"/>
2425
<element name="selectedPage" type="input" selector="#sales_order_create_search_grid_page-current" timeout="30"/>
2526
<element name="nextPageActive" type="button" selector="div.admin__data-grid-pager > button.action-next:not(.disabled)" timeout="30"/>

0 commit comments

Comments
 (0)