@@ -33,36 +33,43 @@ test.describe('Table & Data Model columns table pagination', () => {
3333 ) ;
3434 await tablePageSizeDropdown . scrollIntoViewIfNeeded ( ) ;
3535 await expect ( tablePageSizeDropdown ) . toBeVisible ( ) ;
36- const tablePageSizeOption = page
37- . locator ( '.ant-dropdown:not(.ant-dropdown-hidden)' )
38- . getByRole ( 'menuitem' , { name : '25 / Page' } ) ;
36+ const menuItem = page . getByRole ( 'menuitem' , { name : '25 / Page' } ) ;
3937 await expect ( async ( ) => {
4038 await tablePageSizeDropdown . hover ( ) ;
41- await expect ( tablePageSizeOption ) . toBeVisible ( ) ;
42- } ) . toPass ( { timeout : 15000 } ) ;
43- await tablePageSizeOption . click ( ) ;
39+ if ( ! ( await menuItem . isVisible ( ) ) ) {
40+ await tablePageSizeDropdown . click ( ) ;
41+ }
42+ await expect ( menuItem ) . toBeVisible ( { timeout : 2_000 } ) ;
43+ await menuItem . click ( ) ;
44+ await expect ( tablePageSizeDropdown ) . toHaveText ( '25 / Page' ) ;
45+ } ) . toPass ( {
46+ timeout : 15_000 ,
47+ intervals : [ 500 , 1_000 , 2_000 ] ,
48+ } ) ;
49+
50+
4451
4552 await waitForAllLoadersToDisappear ( page ) ;
4653
4754 // Go to Explore Page
4855 await sidebarClick ( page , SidebarItem . EXPLORE ) ;
4956
5057 await waitForAllLoadersToDisappear ( page ) ;
51-
52- const rowsPerPageDropdown = page . getByTestId ( 'rows-per-page-dropdown' ) ;
53- await expect ( rowsPerPageDropdown . locator ( 'p' ) . first ( ) ) . toHaveText ( '25' ) ;
58+ await expect ( page . getByRole ( 'button' , { name : 'Records' } ) ) . toHaveText ( '25' ) ;
5459
5560 // Change page size to 50
56- const option50 = page . getByTestId ( 'rows-per-page-option-50' ) ;
57- await expect ( async ( ) => {
58- if (
59- ( await rowsPerPageDropdown . getAttribute ( 'aria-expanded' ) ) !== 'true'
60- ) {
61- await rowsPerPageDropdown . click ( ) ;
62- }
63- await expect ( option50 ) . toBeVisible ( ) ;
64- } ) . toPass ( { timeout : 15000 } ) ;
65- await option50 . click ( ) ;
61+ const menuItem1 = page . getByTestId ( 'rows-per-page-option-50' ) ;
62+ const pageSizeRecordBtn = page . getByRole ( 'button' , { name : 'Records' } )
63+ await expect ( async ( ) => {
64+ await pageSizeRecordBtn . click ( ) ;
65+ await expect ( menuItem1 ) . toBeVisible ( { timeout : 2_000 } ) ;
66+ await menuItem1 . click ( ) ;
67+ await expect ( page . getByRole ( 'button' , { name : 'Records' } ) ) . toHaveText ( '50' ) ;
68+ } ) . toPass ( {
69+ timeout : 15_000 ,
70+ intervals : [ 500 , 1_000 , 2_000 ] ,
71+ } ) ;
72+
6673 await waitForAllLoadersToDisappear ( page ) ;
6774
6875 // Go to Users Page
0 commit comments