mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-23 03:34:16 +00:00
increase wait time to 5s
This commit is contained in:
@@ -378,9 +378,11 @@ type PanelOpenOptions = {
|
||||
|
||||
export enum CommandBarButton {
|
||||
Save = "Save",
|
||||
Delete = "Delete",
|
||||
Execute = "Execute",
|
||||
ExecuteQuery = "Execute Query",
|
||||
UploadItem = "Upload Item",
|
||||
NewDocument = "New Document",
|
||||
}
|
||||
|
||||
/** Helper class that provides locator methods for DataExplorer components, on top of a Frame */
|
||||
@@ -478,7 +480,7 @@ export class DataExplorer {
|
||||
return await this.waitForNode(`${databaseId}/${containerId}/Documents`);
|
||||
}
|
||||
|
||||
async waitForCommandBarButton(label: string, timeout?: number): Promise<Locator> {
|
||||
async waitForCommandBarButton(label: CommandBarButton, timeout?: number): Promise<Locator> {
|
||||
const commandBar = this.commandBarButton(label);
|
||||
await commandBar.waitFor({ state: "visible", timeout });
|
||||
return commandBar;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { setupCORSBypass } from "../CORSBypass";
|
||||
import { DataExplorer, DocumentsTab, TestAccount } from "../fx";
|
||||
import { CommandBarButton, DataExplorer, DocumentsTab, TestAccount } from "../fx";
|
||||
import { retry, serializeMongoToJson, setPartitionKeys } from "../testData";
|
||||
import { documentTestCases } from "./testCases";
|
||||
|
||||
@@ -58,7 +58,7 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
||||
await span.click();
|
||||
let newDocumentId;
|
||||
await retry(async () => {
|
||||
const newDocumentButton = await explorer.waitForCommandBarButton("New Document", 5000);
|
||||
const newDocumentButton = await explorer.waitForCommandBarButton(CommandBarButton.NewDocument, 5000);
|
||||
await expect(newDocumentButton).toBeVisible();
|
||||
await expect(newDocumentButton).toBeEnabled();
|
||||
await newDocumentButton.click();
|
||||
@@ -73,8 +73,8 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
||||
};
|
||||
|
||||
await documentsTab.resultsEditor.setText(JSON.stringify(newDocument));
|
||||
await page.waitForTimeout(2000); // wait for editor to process changes
|
||||
const saveButton = await explorer.waitForCommandBarButton("Save", 5000);
|
||||
await page.waitForTimeout(5000); // wait for editor to process changes
|
||||
const saveButton = await explorer.waitForCommandBarButton(CommandBarButton.Save, 5000);
|
||||
await saveButton.click({ timeout: 5000 });
|
||||
await expect(saveButton).toBeHidden({ timeout: 5000 });
|
||||
}, 3);
|
||||
@@ -87,7 +87,7 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
||||
await newSpan.click();
|
||||
await expect(documentsTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });
|
||||
|
||||
const deleteButton = await explorer.waitForCommandBarButton("Delete", 5000);
|
||||
const deleteButton = await explorer.waitForCommandBarButton(CommandBarButton.Delete, 5000);
|
||||
await deleteButton.click();
|
||||
|
||||
const deleteDialogButton = await explorer.waitForDialogButton("Delete", 5000);
|
||||
|
||||
Reference in New Issue
Block a user