Skip to content

Commit

Permalink
fix flaky test x-pack/test/functional/apps/dashboard/group2/panel_tim…
Browse files Browse the repository at this point in the history
…e_range·ts (#150630)

Fixers #150490

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

Failures caused by settings panel not closing. PR resolves issue by
dismissing toasts so save button is clickable and retrying if settings
panel does not close.

<img width="500" alt="Screen Shot 2023-02-08 at 12 30 19 PM"
src="https://user-images.githubusercontent.com/373691/217639189-c1da31e8-b9d8-4d60-b95f-2e04b1d5c228.png">

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
nreese and kibanamachine authored Feb 9, 2023
1 parent 3faf6f5 commit cb17912
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/functional/services/dashboard/panel_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { CommonlyUsed } from '../../page_objects/time_picker';

export function DashboardCustomizePanelProvider({ getService }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const toasts = getService('toasts');
const testSubjects = getService('testSubjects');

return new (class DashboardCustomizePanel {
Expand Down Expand Up @@ -95,12 +97,19 @@ export function DashboardCustomizePanelProvider({ getService }: FtrProviderConte

public async clickSaveButton() {
log.debug('clickSaveButton');
await testSubjects.click('saveCustomizePanelButton');
await retry.try(async () => {
await toasts.dismissAllToasts();
await testSubjects.click('saveCustomizePanelButton');
await testSubjects.waitForDeleted('saveCustomizePanelButton');
});
}

public async clickCancelButton() {
log.debug('clickCancelButton');
await testSubjects.click('cancelCustomizePanelButton');
await retry.try(async () => {
await testSubjects.click('cancelCustomizePanelButton');
await testSubjects.waitForDeleted('cancelCustomizePanelButton');
});
}

public async clickToggleShowCustomTimeRange() {
Expand Down

0 comments on commit cb17912

Please sign in to comment.