From e4e0bb698338f4a022b5f0c7cd3faca2d3de310e Mon Sep 17 00:00:00 2001 From: ktx-akshay Date: Thu, 27 Nov 2025 13:27:48 +0530 Subject: [PATCH] test: enhance stability of dashboard creation process in UI tests (#9342) --- .../pages/dashboardPages/visualise.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/ui-testing/pages/dashboardPages/visualise.js b/tests/ui-testing/pages/dashboardPages/visualise.js index 74a9a862ef..d00be2cbc9 100644 --- a/tests/ui-testing/pages/dashboardPages/visualise.js +++ b/tests/ui-testing/pages/dashboardPages/visualise.js @@ -462,12 +462,25 @@ export default class LogsVisualise { await this.addToDashboardBtn.waitFor({ state: "visible", timeout: 5000 }); await this.addToDashboardBtn.click(); - // Wait for and click new dashboard option - await this.newDashboardBtn.waitFor({ state: "visible", timeout: 5000 }); + // Wait for the "Add to Dashboard" side panel to fully load + const sidePanelTitle = this.page.locator('[data-test="schema-title-text"]'); + await sidePanelTitle.waitFor({ state: "visible", timeout: 10000 }); + await sidePanelTitle.waitFor({ state: "attached", timeout: 5000 }); + + // Wait for the "new dashboard" button to be visible and stable + await this.newDashboardBtn.waitFor({ state: "visible", timeout: 10000 }); + await this.newDashboardBtn.waitFor({ state: "attached", timeout: 5000 }); + // await this.page.waitForTimeout(500); + + // Click new dashboard option await this.newDashboardBtn.click(); + // Wait for the "New dashboard" dialog to open and stabilize + await this.dashboardNameInput.waitFor({ state: "visible", timeout: 10000 }); + await this.dashboardNameInput.waitFor({ state: "attached", timeout: 5000 }); + // await this.page.waitForTimeout(500); + // Fill dashboard name - await this.dashboardNameInput.waitFor({ state: "visible", timeout: 5000 }); await this.dashboardNameInput.click(); await this.dashboardNameInput.fill(randomDashboardName);