fix Failing test: X-Pack Saved Object Tagging Functional Tests.x-pack/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 (#160687)

Closes https://github.com/elastic/kibana/issues/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 <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2023-06-28 10:14:50 -06:00 committed by GitHub
parent 27b82d9995
commit ef7fda2d24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
@ -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');