Skip to content

Commit

Permalink
[Discover] Fix flaky data grid header row height test (elastic#183896)
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta authored May 22, 2024
1 parent 97de948 commit 95510c1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/functional/services/data_grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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) {
Expand Down

0 comments on commit 95510c1

Please sign in to comment.