From 95510c1d83753fd90f23da447a53943d6e28c39b Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Wed, 22 May 2024 09:16:23 +0200 Subject: [PATCH] [Discover] Fix flaky data grid header row height test (#183896) - Closes https://github.com/elastic/kibana/issues/182785 30x https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6055 --- test/functional/services/data_grid.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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) {