used setText instead of keyboardinput wait

This commit is contained in:
nishthaAhujaa
2026-01-07 16:28:37 +05:30
parent 60987c963c
commit f39a5cf8eb

View File

@@ -1,6 +1,6 @@
import { expect, test, type Page } from "@playwright/test"; import { expect, test, type Page } from "@playwright/test";
import { DataExplorer, TestAccount } from "../fx"; import { CommandBarButton, DataExplorer, TestAccount } from "../fx";
import { createTestSQLContainer, TestContainerContext } from "../testData"; import { createTestSQLContainer, TestContainerContext } from "../testData";
// Test container context for setup and cleanup // Test container context for setup and cleanup
@@ -35,18 +35,16 @@ async function setupIndexAdvisorTab(page: Page, customQuery?: string) {
await page.waitForTimeout(2000); await page.waitForTimeout(2000);
const queryTab = explorer.queryTab("tab0"); const queryTab = explorer.queryTab("tab0");
await queryTab.editor().locator.waitFor({ timeout: 30 * 1000 }); const queryEditor = queryTab.editor();
await queryTab.editor().locator.click(); await queryEditor.locator.waitFor({ timeout: 30 * 1000 });
await queryTab.executeCTA.waitFor();
if (customQuery) { if (customQuery) {
// Clear the default query and type the custom query await queryEditor.locator.click();
await page.keyboard.press("Control+A"); await queryEditor.setText(customQuery);
await page.waitForTimeout(100);
await page.keyboard.type(customQuery);
await page.waitForTimeout(500);
} }
const executeQueryButton = explorer.commandBarButton("Execute Query"); const executeQueryButton = explorer.commandBarButton(CommandBarButton.ExecuteQuery);
await executeQueryButton.click(); await executeQueryButton.click();
await expect(queryTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 }); await expect(queryTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });