mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-26 13:14:04 +00:00
used setText instead of keyboardinput wait
This commit is contained in:
@@ -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 });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user