From c60227c089acd43632f9002f3fb6346e5084aebb Mon Sep 17 00:00:00 2001 From: Hannah Mudge Date: Thu, 14 Mar 2024 08:37:56 -0600 Subject: [PATCH] [Controls] Fix flaky apply button test (#178661) Closes https://github.com/elastic/kibana/issues/178581 ## Summary Because the control group publishes its own filters to trigger unsaved changes, and because the controls must **load** for the filters to be published, we need to await for each control to load **before** saving the dashboard - otherwise, if the controls fully load **after** the dashboard is saved, this can re-trigger the unsaved changes badge. ### [Flaky Test Runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5472) ![image](https://github.com/elastic/kibana/assets/8698078/271ecbca-9aee-43c1-83cf-54b4b7bf5a0d) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --- .../controls/common/control_group_apply_button.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts b/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts index 2db32144f4ad6..b1b40002ae153 100644 --- a/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts +++ b/test/functional/apps/dashboard_elements/controls/common/control_group_apply_button.ts @@ -24,8 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'header', ]); - // FLAKY: https://github.com/elastic/kibana/issues/178581 - describe.skip('Dashboard control group apply button', () => { + describe('Dashboard control group apply button', () => { let controlIds: string[]; before(async () => { @@ -51,7 +50,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { title: 'Animal Name', }); await dashboardControls.createTimeSliderControl(); + + // wait for all controls to finish loading before saving controlIds = await dashboardControls.getAllControlIds(); + await dashboardControls.optionsListWaitForLoading(controlIds[0]); + await dashboardControls.rangeSliderWaitForLoading(controlIds[1]); // save the dashboard await dashboard.saveDashboard('Test Control Group Apply Button', { exitFromEditMode: false });