Skip to content

Commit

Permalink
fix Failing test: X-Pack Saved Object Tagging Functional Tests.x-pack…
Browse files Browse the repository at this point in the history
…/test/saved_object_tagging/functional/tests/dashboard_integration·ts - saved objects tagging - functional tests dashboard integration creating allows to select tags for a new dashboard (elastic#160687)

Closes elastic#160583

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

Harden `dashboard_page.enterDashboardTitleAndClickSave` for retry loops
so does not try to open save dialog when its already open from first
save attempt failure.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ef7fda2)
  • Loading branch information
nreese committed Jun 28, 2023
1 parent 524dc02 commit a4fe56b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/functional/page_objects/dashboard_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,10 @@ export class DashboardPageObject extends FtrService {
*/
public async saveDashboard(
dashboardName: string,
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true },
clickMenuItem = true
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true }
) {
await this.retry.try(async () => {
await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions, clickMenuItem);
await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions);

if (saveOptions.needsConfirm) {
await this.ensureDuplicateTitleCallout();
Expand Down Expand Up @@ -516,10 +515,12 @@ export class DashboardPageObject extends FtrService {
*/
public async enterDashboardTitleAndClickSave(
dashboardTitle: string,
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true },
clickMenuItem = true
saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true }
) {
if (clickMenuItem) {
const isSaveModalOpen = await this.testSubjects.exists('savedObjectSaveModal', {
timeout: 2000,
});
if (!isSaveModalOpen) {
await this.testSubjects.click('dashboardSaveMenuItem');
}
const modalDialog = await this.testSubjects.find('savedObjectSaveModal');
Expand Down

0 comments on commit a4fe56b

Please sign in to comment.