mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
fix flaky test Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps/group2/embeddable/add_to_dashboard·js (#168500)
Closes https://github.com/elastic/kibana/issues/168029 flaky test runner https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3447 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
91cdbe2d35
commit
f088e55fdd
1 changed files with 17 additions and 8 deletions
|
@ -27,6 +27,7 @@ export class TimeToVisualizePageObject extends FtrService {
|
|||
private readonly find = this.ctx.getService('find');
|
||||
private readonly common = this.ctx.getPageObject('common');
|
||||
private readonly dashboard = this.ctx.getPageObject('dashboard');
|
||||
private readonly retry = this.ctx.getService('retry');
|
||||
|
||||
public async ensureSaveModalIsOpen() {
|
||||
await this.testSubjects.exists('savedObjectSaveModal', { timeout: 5000 });
|
||||
|
@ -47,6 +48,21 @@ export class TimeToVisualizePageObject extends FtrService {
|
|||
await this.dashboard.clickNewDashboard(false);
|
||||
}
|
||||
|
||||
private async selectDashboard(dashboardId: string) {
|
||||
await this.retry.try(async () => {
|
||||
await this.testSubjects.waitForEnabled('open-dashboard-picker');
|
||||
await this.testSubjects.click('open-dashboard-picker');
|
||||
await this.testSubjects.setValue('dashboard-picker-search', dashboardId);
|
||||
await this.common.sleep(150); // wait for input debounce so loading starts
|
||||
await this.testSubjects.waitForEnabled('open-dashboard-picker');
|
||||
await this.testSubjects.click(`dashboard-picker-option-${dashboardId.replaceAll(' ', '-')}`);
|
||||
const dashboardPickerLabel = await this.testSubjects.getVisibleText('open-dashboard-picker');
|
||||
if (dashboardPickerLabel === 'Select dashboard') {
|
||||
throw new Error(`Dashboard not selected`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async setSaveModalValues(
|
||||
vizName: string,
|
||||
{ saveAsNew, redirectToOrigin, addToDashboard, dashboardId, saveToLibrary }: SaveModalArgs = {}
|
||||
|
@ -75,14 +91,7 @@ export class TimeToVisualizePageObject extends FtrService {
|
|||
await label.click();
|
||||
|
||||
if (dashboardId) {
|
||||
await this.testSubjects.waitForEnabled('open-dashboard-picker');
|
||||
await this.testSubjects.click('open-dashboard-picker');
|
||||
await this.testSubjects.setValue('dashboard-picker-search', dashboardId);
|
||||
await this.common.sleep(150); // wait for input debounce so loading starts
|
||||
await this.testSubjects.waitForEnabled('open-dashboard-picker');
|
||||
await this.testSubjects.click(
|
||||
`dashboard-picker-option-${dashboardId.replaceAll(' ', '-')}`
|
||||
);
|
||||
await this.selectDashboard(dashboardId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue