@@ -236,17 +236,13 @@ test.describe('Diagnostics Queries tab', async () => {
236236 await expect ( diagnostics . table . isVisible ( ) ) . resolves . toBe ( true ) ;
237237
238238 // Check that FixedHeightQuery components have the expected fixed height
239- const fixedHeightElements = page . locator ( '.ydb-fixed-height-query' ) ;
240- const elementCount = await fixedHeightElements . count ( ) ;
239+ const rowCount = await diagnostics . table . getRowCount ( ) ;
241240
242- if ( elementCount > 1 ) {
241+ if ( rowCount > 1 ) {
243242 // Check that all FixedHeightQuery components have the same height
244243 const heights = [ ] ;
245- for ( let i = 0 ; i < Math . min ( elementCount , 5 ) ; i ++ ) {
246- const element = fixedHeightElements . nth ( i ) ;
247- const height = await element . evaluate ( ( el ) => {
248- return window . getComputedStyle ( el ) . height ;
249- } ) ;
244+ for ( let i = 0 ; i < Math . min ( rowCount , 5 ) ; i ++ ) {
245+ const height = await diagnostics . getFixedHeightQueryElementHeight ( i ) ;
250246 heights . push ( height ) ;
251247 }
252248
@@ -298,9 +294,8 @@ test.describe('Diagnostics Queries tab', async () => {
298294 await page . waitForTimeout ( 500 ) ;
299295
300296 // Find and click the copy link button in the drawer
301- const copyLinkButton = page . locator ( '.ydb-copy-link-button__icon' ) . first ( ) ;
302- await expect ( copyLinkButton ) . toBeVisible ( ) ;
303- await copyLinkButton . click ( ) ;
297+ await expect ( diagnostics . isCopyLinkButtonVisible ( ) ) . resolves . toBe ( true ) ;
298+ await diagnostics . clickCopyLinkButton ( ) ;
304299
305300 // Get the copied URL from clipboard
306301 const clipboardText = await page . evaluate ( ( ) => navigator . clipboard . readText ( ) ) ;
@@ -313,11 +308,9 @@ test.describe('Diagnostics Queries tab', async () => {
313308
314309 const firstVisibleRowIndex = 4 ;
315310 // Verify the row is highlighted/selected (if applicable)
316- const rowElement = page . locator ( `tr.data-table__row:nth-child(${ firstVisibleRowIndex } )` ) ;
317- const rowElementClass = await rowElement . getAttribute ( 'class' ) ;
318311 await page . waitForTimeout ( 1000 ) ;
319312
320- const hasActiveClass = rowElementClass ?. includes ( 'kv-top-queries__row_active' ) ;
313+ const hasActiveClass = await diagnostics . isRowActive ( firstVisibleRowIndex ) ;
321314
322315 expect ( hasActiveClass ) . toBe ( true ) ;
323316 } ) ;
0 commit comments