@@ -120,6 +120,27 @@ export class Table {
120120 } ) ;
121121 return true ;
122122 }
123+
124+ async clickRow ( row : number ) {
125+ const rowElement = this . table . locator ( `tr.data-table__row:nth-child(${ row } )` ) ;
126+ await rowElement . click ( ) ;
127+ }
128+
129+ async getRowPosition ( row : number ) {
130+ const rowElement = this . table . locator ( `tr.data-table__row:nth-child(${ row } )` ) ;
131+ return await rowElement . boundingBox ( ) ;
132+ }
133+
134+ async isRowVisible ( row : number ) {
135+ const rowElement = this . table . locator ( `tr.data-table__row:nth-child(${ row } )` ) ;
136+ const boundingBox = await rowElement . boundingBox ( ) ;
137+ if ( ! boundingBox ) {
138+ return false ;
139+ }
140+
141+ const viewportHeight = await rowElement . page ( ) . evaluate ( ( ) => window . innerHeight ) ;
142+ return boundingBox . y >= 0 && boundingBox . y + boundingBox . height <= viewportHeight ;
143+ }
123144}
124145
125146export enum QueriesSwitch {
@@ -222,6 +243,8 @@ export class Diagnostics {
222243 private memoryCard : Locator ;
223244 private healthcheckCard : Locator ;
224245 private tableRadioButton : Locator ;
246+ private fixedHeightQueryElements : Locator ;
247+ private copyLinkButton : Locator ;
225248
226249 constructor ( page : Page ) {
227250 this . storage = new StoragePage ( page ) ;
@@ -238,6 +261,8 @@ export class Diagnostics {
238261 this . tableRadioButton = page . locator (
239262 '.ydb-table-with-controls-layout__controls .g-radio-button' ,
240263 ) ;
264+ this . fixedHeightQueryElements = page . locator ( '.ydb-fixed-height-query' ) ;
265+ this . copyLinkButton = page . locator ( '.ydb-copy-link-button__icon' ) ;
241266
242267 // Info tab cards
243268 this . cpuCard = page . locator ( '.metrics-cards__tab:has-text("CPU")' ) ;
@@ -373,4 +398,29 @@ export class Diagnostics {
373398 . textContent ( ) ;
374399 return selectedText ?. trim ( ) || '' ;
375400 }
401+
402+ async getFixedHeightQueryElementsCount ( ) : Promise < number > {
403+ return await this . fixedHeightQueryElements . count ( ) ;
404+ }
405+
406+ async getFixedHeightQueryElementHeight ( index : number ) : Promise < string > {
407+ const element = this . fixedHeightQueryElements . nth ( index ) ;
408+ return await element . evaluate ( ( el ) => {
409+ return window . getComputedStyle ( el ) . height ;
410+ } ) ;
411+ }
412+
413+ async clickCopyLinkButton ( ) : Promise < void > {
414+ await this . copyLinkButton . first ( ) . click ( ) ;
415+ }
416+
417+ async isCopyLinkButtonVisible ( ) : Promise < boolean > {
418+ return await this . copyLinkButton . first ( ) . isVisible ( ) ;
419+ }
420+
421+ async isRowActive ( rowIndex : number ) : Promise < boolean > {
422+ const rowElement = this . dataTable . locator ( `tr.data-table__row:nth-child(${ rowIndex } )` ) ;
423+ const rowElementClass = await rowElement . getAttribute ( 'class' ) ;
424+ return rowElementClass ?. includes ( 'kv-top-queries__row_active' ) || false ;
425+ }
376426}
0 commit comments