Skip to content

Commit

Permalink
unskip Failing test: Dashboard Elements - Controls tests.test/functio…
Browse files Browse the repository at this point in the history
…nal/apps/dashboard_elements/controls/common/control_group_chaining·ts - Controls Dashboard control group hierarchical chaining Creating "does not exist" query from first control filters the second and third controls (elastic#163350)

Closes elastic#162777

flaky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2811

Failure image shows options list is still open. PR updates
optionsListEnsurePopoverIsClosed with logic to prevent 2 possible issues
1) retry added to ensure missed click will attempt to close options list
again
2) check options list is open before clicking. This will resolve issue
where options list is closed and clicking actually opens it again


![image](https://github.com/elastic/kibana/assets/373691/06a6673c-e92f-4a45-8910-8a0a1a7c5776)

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
2 people authored and bryce-b committed Aug 9, 2023
1 parent d15ca1a commit c200df6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'header',
]);

// Failing: See https://github.com/elastic/kibana/issues/162777
describe.skip('Dashboard control group hierarchical chaining', () => {
describe('Dashboard control group hierarchical chaining', () => {
const newDocuments: Array<{ index: string; id: string }> = [];
let controlIds: string[];

Expand Down
18 changes: 15 additions & 3 deletions test/functional/page_objects/dashboard_page_controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,30 @@ export class DashboardPageControls extends FtrService {
return (await controlElement.getVisibleText()).split('\n')[1];
}

public async isOptionsListPopoverOpen(controlId: string) {
const isPopoverOpen = await this.find.existsByCssSelector(`#control-popover-${controlId}`);
this.log.debug(`Is popover open: ${isPopoverOpen} for Options List: ${controlId}`);
return isPopoverOpen;
}

public async optionsListOpenPopover(controlId: string) {
this.log.debug(`Opening popover for Options List: ${controlId}`);

await this.testSubjects.click(`optionsList-control-${controlId}`);
await this.retry.try(async () => {
await this.testSubjects.existOrFail(`optionsList-control-popover`);
});
}

public async optionsListEnsurePopoverIsClosed(controlId: string) {
this.log.debug(`Opening popover for Options List: ${controlId}`);
await this.testSubjects.click(`optionsList-control-${controlId}`);
await this.testSubjects.waitForDeleted(`optionsList-control-available-options`);
this.log.debug(`Ensure popover is closed for Options List: ${controlId}`);
await this.retry.try(async () => {
const isPopoverOpen = await this.isOptionsListPopoverOpen(controlId);
if (isPopoverOpen) {
await this.testSubjects.click(`optionsList-control-${controlId}`);
await this.testSubjects.waitForDeleted(`optionsList-control-available-options`);
}
});
}

public async optionsListPopoverAssertOpen() {
Expand Down

0 comments on commit c200df6

Please sign in to comment.