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