diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index a6c91d91a8961..18282442696ff 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -376,12 +376,12 @@ export class DataGridService extends FtrService { await this.testSubjects.click('dataGridDisplaySelectorButton'); } - public async getCurrentRowHeightValue() { + public async getCurrentRowHeightValue(scope: 'row' | 'header' = 'row') { const buttonGroup = await this.testSubjects.find( - 'unifiedDataTableRowHeightSettings_rowHeightButtonGroup' + `unifiedDataTable${scope === 'header' ? 'Header' : ''}RowHeightSettings_rowHeightButtonGroup` ); let value = ''; - await this.retry.waitFor('row height value not to be empty', async () => { + await this.retry.waitFor(`${scope} height value not to be empty`, async () => { // to prevent flakiness const selectedButton = await buttonGroup.findByCssSelector( '.euiButtonGroupButton-isSelected' @@ -401,12 +401,7 @@ export class DataGridService extends FtrService { } public async getCurrentHeaderRowHeightValue() { - const buttonGroup = await this.testSubjects.find( - 'unifiedDataTableHeaderRowHeightSettings_rowHeightButtonGroup' - ); - return ( - await buttonGroup.findByCssSelector('.euiButtonGroupButton-isSelected') - ).getVisibleText(); + return await this.getCurrentRowHeightValue('header'); } public async changeHeaderRowHeightValue(newValue: string) {