Skip to content

Commit

Permalink
Rely on elastic#166239 for handling the opening of the super date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila committed Sep 21, 2023
1 parent 5bf114e commit 28132c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions test/functional/services/dashboard/add_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ export class DashboardAddPanelService extends FtrService {
await this.testSubjects.click(`savedObjectTitle${embeddableName.split(' ').join('-')}`);
await this.testSubjects.exists('addObjectToDashboardSuccess');
await this.closeAddPanel();

// close "Added successfully" toast
await this.common.clearAllToasts();
return embeddableName;
}

Expand Down
19 changes: 8 additions & 11 deletions test/functional/services/dashboard/panel_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function DashboardCustomizePanelProvider({ getService, getPageObject }: F
}

public async findCustomTimeRangeToggleButton(): Promise<WebElementWrapper> {
log.debug('findCustomTimeRangeToggleButton');
let button: WebElementWrapper | undefined;
await retry.waitFor('custom time range toggle button', async () => {
button = await testSubjects.find(this.TOGGLE_TIME_RANGE_TEST_SUBJ);
Expand Down Expand Up @@ -99,18 +100,14 @@ export function DashboardCustomizePanelProvider({ getService, getPageObject }: F

public async openDatePickerQuickMenu() {
log.debug('openDatePickerQuickMenu');
const button = await this.findDatePickerQuickMenuButton();

await retry.try(async () => {
if (!(await testSubjects.isDisplayed('superDatePickerQuickMenu'))) {
await button.click();
await retry.waitForWithTimeout(
'super date picker quick menu to be displayed',
1000,
async () => await testSubjects.isDisplayed('superDatePickerQuickMenu')
);
}
let button: WebElementWrapper | undefined;
await retry.waitFor('superDatePickerToggleQuickMenuButton to be present', async () => {
button = await this.findDatePickerQuickMenuButton();
return Boolean(button);
});
if (button) {
await button.click();
}
}

public async clickCommonlyUsedTimeRange(time: CommonlyUsed) {
Expand Down

0 comments on commit 28132c7

Please sign in to comment.