From f39a5cf8ebbfbfc6ba1ba28e7bbc0981e3b520b4 Mon Sep 17 00:00:00 2001 From: nishthaAhujaa Date: Wed, 7 Jan 2026 16:28:37 +0530 Subject: [PATCH] used setText instead of keyboardinput wait --- test/sql/indexAdvisor.spec.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test/sql/indexAdvisor.spec.ts b/test/sql/indexAdvisor.spec.ts index 10c930b47..4d9ac6aa2 100644 --- a/test/sql/indexAdvisor.spec.ts +++ b/test/sql/indexAdvisor.spec.ts @@ -1,6 +1,6 @@ import { expect, test, type Page } from "@playwright/test"; -import { DataExplorer, TestAccount } from "../fx"; +import { CommandBarButton, DataExplorer, TestAccount } from "../fx"; import { createTestSQLContainer, TestContainerContext } from "../testData"; // Test container context for setup and cleanup @@ -35,18 +35,16 @@ async function setupIndexAdvisorTab(page: Page, customQuery?: string) { await page.waitForTimeout(2000); const queryTab = explorer.queryTab("tab0"); - await queryTab.editor().locator.waitFor({ timeout: 30 * 1000 }); - await queryTab.editor().locator.click(); + const queryEditor = queryTab.editor(); + await queryEditor.locator.waitFor({ timeout: 30 * 1000 }); + await queryTab.executeCTA.waitFor(); if (customQuery) { - // Clear the default query and type the custom query - await page.keyboard.press("Control+A"); - await page.waitForTimeout(100); - await page.keyboard.type(customQuery); - await page.waitForTimeout(500); + await queryEditor.locator.click(); + await queryEditor.setText(customQuery); } - const executeQueryButton = explorer.commandBarButton("Execute Query"); + const executeQueryButton = explorer.commandBarButton(CommandBarButton.ExecuteQuery); await executeQueryButton.click(); await expect(queryTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });