Skip to content

Commit

Permalink
[Controls] Fix flaky apply button test (elastic#178661)
Browse files Browse the repository at this point in the history
Closes elastic#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)
  • Loading branch information
Heenawter authored Mar 14, 2024
1 parent 0c64dc6 commit c60227c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 });
Expand Down

0 comments on commit c60227c

Please sign in to comment.