Skip to content

Commit

Permalink
[Discover] Fix flaky "visualize in lens" test (elastic#146863)
Browse files Browse the repository at this point in the history
Closes elastic#141616

https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1615
(cherry picked from commit 61930b7)

# Conflicts:
#	test/functional/page_objects/discover_page.ts
  • Loading branch information
jughosta committed Dec 6, 2022
1 parent 33c8b50 commit 0a766eb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/functional/page_objects/discover_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,16 @@ export class DiscoverPageObject extends FtrService {
return await this.testSubjects.exists('discoverNoResultsTimefilter');
}

public async waitUntilFieldPopoverIsOpen() {
await this.retry.waitFor('popover is open', async () => {
return Boolean(await this.find.byCssSelector('[data-popover-open="true"]'));
});
}

public async clickFieldListItem(field: string) {
return await this.testSubjects.click(`field-${field}`);
await this.testSubjects.click(`field-${field}`);

await this.waitUntilFieldPopoverIsOpen();
}

public async clickFieldSort(field: string, text = 'Sort New-Old') {
Expand Down Expand Up @@ -501,6 +509,7 @@ export class DiscoverPageObject extends FtrService {
await field.click();
}

await this.waitUntilFieldPopoverIsOpen();
await this.testSubjects.click(`fieldVisualize-${fieldName}`);
await this.header.waitUntilLoadingHasFinished();
}
Expand Down

0 comments on commit 0a766eb

Please sign in to comment.