mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-27 21:54:15 +00:00
Fix playwright tests (#2342)
* dont refresh tree when opening scale & settings * disable offline/online migration tests * delete db after each test * DEBUG: expand console for mongo testing * find first execute button for stored procedure * DEBUG: wait for editor to process changes * increase wait time to 5s * verify document text was set * keep document spec as original * debug new document and save document count * when loading a document, wait for document text to appear then click new document * wait for document to be loaded * remove debug statement * wait for results to attach * do forced wait instead * cleanup tests * uncomment container copy tests * run test account cleanup every 12 hours * change cleanup frequency to once a day --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
13
test/fx.ts
13
test/fx.ts
@@ -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;
|
||||
@@ -515,15 +517,6 @@ export class DataExplorer {
|
||||
const containerNode = await this.waitForContainerNode(context.database.id, context.container.id);
|
||||
await containerNode.expand();
|
||||
|
||||
// refresh tree to remove deleted database
|
||||
const consoleMessages = await this.getNotificationConsoleMessages();
|
||||
const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton");
|
||||
await refreshButton.click();
|
||||
await expect(consoleMessages).toContainText("Successfully refreshed databases", {
|
||||
timeout: ONE_MINUTE_MS,
|
||||
});
|
||||
await this.collapseNotificationConsole();
|
||||
|
||||
const scaleAndSettingsButton = this.frame.getByTestId(
|
||||
`TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user