From 664575287358b9652039e268cacc5a4d2a533c65 Mon Sep 17 00:00:00 2001 From: Jade Welton Date: Fri, 10 Jul 2026 07:16:07 -0700 Subject: [PATCH] Enable other API tests --- test/cassandra/container.spec.ts | 86 ++++++++++++------------- test/gremlin/container.spec.ts | 92 +++++++++++++-------------- test/mongo/container.spec.ts | 104 +++++++++++++++---------------- test/tables/container.spec.ts | 60 +++++++++--------- 4 files changed, 171 insertions(+), 171 deletions(-) diff --git a/test/cassandra/container.spec.ts b/test/cassandra/container.spec.ts index 999e03304..a8262ca50 100644 --- a/test/cassandra/container.spec.ts +++ b/test/cassandra/container.spec.ts @@ -1,51 +1,51 @@ -// import { expect, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; -// import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; +import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; -// test("Cassandra keyspace and table CRUD", async ({ page }) => { -// const keyspaceId = generateUniqueName("db"); -// const tableId = "testtable"; // A unique table name isn't needed because the keyspace is unique +test("Cassandra keyspace and table CRUD", async ({ page }) => { + const keyspaceId = generateUniqueName("db"); + const tableId = "testtable"; // A unique table name isn't needed because the keyspace is unique -// const explorer = await DataExplorer.open(page, TestAccount.Cassandra); + const explorer = await DataExplorer.open(page, TestAccount.Cassandra); -// const newTableButton = await explorer.globalCommandButton("New Table"); -// await newTableButton.click(); -// await explorer.whilePanelOpen( -// "Add Table", -// async (panel, okButton) => { -// await panel.getByPlaceholder("Type a new keyspace id").fill(keyspaceId); -// await panel.getByPlaceholder("Enter table Id").fill(tableId); -// await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + const newTableButton = await explorer.globalCommandButton("New Table"); + await newTableButton.click(); + await explorer.whilePanelOpen( + "Add Table", + async (panel, okButton) => { + await panel.getByPlaceholder("Type a new keyspace id").fill(keyspaceId); + await panel.getByPlaceholder("Enter table Id").fill(tableId); + await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// const keyspaceNode = await explorer.waitForNode(keyspaceId); -// const tableNode = await explorer.waitForContainerNode(keyspaceId, tableId); + const keyspaceNode = await explorer.waitForNode(keyspaceId); + const tableNode = await explorer.waitForContainerNode(keyspaceId, tableId); -// await tableNode.openContextMenu(); -// await tableNode.contextMenuItem("Delete Table").click(); -// await explorer.whilePanelOpen( -// "Delete Table", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the table id" }).fill(tableId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); -// await expect(tableNode.element).not.toBeAttached(); + await tableNode.openContextMenu(); + await tableNode.contextMenuItem("Delete Table").click(); + await explorer.whilePanelOpen( + "Delete Table", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the table id" }).fill(tableId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); + await expect(tableNode.element).not.toBeAttached(); -// await keyspaceNode.openContextMenu(); -// await keyspaceNode.contextMenuItem("Delete Keyspace").click(); -// await explorer.whilePanelOpen( -// "Delete Keyspace", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the Keyspace id" }).fill(keyspaceId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + await keyspaceNode.openContextMenu(); + await keyspaceNode.contextMenuItem("Delete Keyspace").click(); + await explorer.whilePanelOpen( + "Delete Keyspace", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the Keyspace id" }).fill(keyspaceId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// await expect(keyspaceNode.element).not.toBeAttached(); -// }); + await expect(keyspaceNode.element).not.toBeAttached(); +}); diff --git a/test/gremlin/container.spec.ts b/test/gremlin/container.spec.ts index e85cd4f44..09dcbf7e6 100644 --- a/test/gremlin/container.spec.ts +++ b/test/gremlin/container.spec.ts @@ -1,54 +1,54 @@ -// import { expect, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; -// import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; +import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; -// test("Gremlin graph CRUD", async ({ page }) => { -// test.skip(); -// const databaseId = generateUniqueName("db"); -// const graphId = "testgraph"; // A unique graph name isn't needed because the database is unique +test("Gremlin graph CRUD", async ({ page }) => { + test.skip(); + const databaseId = generateUniqueName("db"); + const graphId = "testgraph"; // A unique graph name isn't needed because the database is unique -// const explorer = await DataExplorer.open(page, TestAccount.Gremlin); + const explorer = await DataExplorer.open(page, TestAccount.Gremlin); -// // Create new database and graph -// const newGraphButton = await explorer.globalCommandButton("New Graph"); -// await newGraphButton.click(); -// await explorer.whilePanelOpen( -// "New Graph", -// async (panel, okButton) => { -// await panel.getByPlaceholder("Type a new database id").fill(databaseId); -// await panel.getByRole("textbox", { name: "Graph id, Example Graph1" }).fill(graphId); -// await panel.getByRole("textbox", { name: "Partition key" }).fill("/pk"); -// await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + // Create new database and graph + const newGraphButton = await explorer.globalCommandButton("New Graph"); + await newGraphButton.click(); + await explorer.whilePanelOpen( + "New Graph", + async (panel, okButton) => { + await panel.getByPlaceholder("Type a new database id").fill(databaseId); + await panel.getByRole("textbox", { name: "Graph id, Example Graph1" }).fill(graphId); + await panel.getByRole("textbox", { name: "Partition key" }).fill("/pk"); + await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// const databaseNode = await explorer.waitForNode(databaseId); -// const graphNode = await explorer.waitForContainerNode(databaseId, graphId); + const databaseNode = await explorer.waitForNode(databaseId); + const graphNode = await explorer.waitForContainerNode(databaseId, graphId); -// await graphNode.openContextMenu(); -// await graphNode.contextMenuItem("Delete Graph").click(); -// await explorer.whilePanelOpen( -// "Delete Graph", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the graph id" }).fill(graphId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); -// await expect(graphNode.element).not.toBeAttached(); + await graphNode.openContextMenu(); + await graphNode.contextMenuItem("Delete Graph").click(); + await explorer.whilePanelOpen( + "Delete Graph", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the graph id" }).fill(graphId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); + await expect(graphNode.element).not.toBeAttached(); -// await databaseNode.openContextMenu(); -// await databaseNode.contextMenuItem("Delete Database").click(); -// await explorer.whilePanelOpen( -// "Delete Database", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the Database id" }).fill(databaseId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + await databaseNode.openContextMenu(); + await databaseNode.contextMenuItem("Delete Database").click(); + await explorer.whilePanelOpen( + "Delete Database", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the Database id" }).fill(databaseId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// await expect(databaseNode.element).not.toBeAttached(); -// }); + await expect(databaseNode.element).not.toBeAttached(); +}); diff --git a/test/mongo/container.spec.ts b/test/mongo/container.spec.ts index 100c8e7a1..4a14fa42a 100644 --- a/test/mongo/container.spec.ts +++ b/test/mongo/container.spec.ts @@ -1,60 +1,60 @@ -// import { expect, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; -// import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; +import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; -// ( -// [ -// ["latest API version", TestAccount.Mongo], -// ["3.2 API", TestAccount.Mongo32], -// ] as [string, TestAccount][] -// ).forEach(([apiVersionDescription, accountType]) => { -// test(`Mongo CRUD using ${apiVersionDescription}`, async ({ page }) => { -// test.skip(); -// const databaseId = generateUniqueName("db"); -// const collectionId = "testcollection"; // A unique collection name isn't needed because the database is unique +( + [ + ["latest API version", TestAccount.Mongo], + ["3.2 API", TestAccount.Mongo32], + ] as [string, TestAccount][] +).forEach(([apiVersionDescription, accountType]) => { + test(`Mongo CRUD using ${apiVersionDescription}`, async ({ page }) => { + test.skip(); + const databaseId = generateUniqueName("db"); + const collectionId = "testcollection"; // A unique collection name isn't needed because the database is unique -// const explorer = await DataExplorer.open(page, accountType); + const explorer = await DataExplorer.open(page, accountType); -// const newCollectionButton = await explorer.globalCommandButton("New Collection"); -// await newCollectionButton.click(); -// await explorer.whilePanelOpen( -// "New Collection", -// async (panel, okButton) => { -// await panel.getByPlaceholder("Type a new database id").fill(databaseId); -// await panel.getByRole("textbox", { name: "Collection id, Example Collection1" }).fill(collectionId); -// await panel.getByRole("textbox", { name: "Shard key" }).fill("pk"); -// await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + const newCollectionButton = await explorer.globalCommandButton("New Collection"); + await newCollectionButton.click(); + await explorer.whilePanelOpen( + "New Collection", + async (panel, okButton) => { + await panel.getByPlaceholder("Type a new database id").fill(databaseId); + await panel.getByRole("textbox", { name: "Collection id, Example Collection1" }).fill(collectionId); + await panel.getByRole("textbox", { name: "Shard key" }).fill("pk"); + await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// const databaseNode = await explorer.waitForNode(databaseId); -// const collectionNode = await explorer.waitForContainerNode(databaseId, collectionId); + const databaseNode = await explorer.waitForNode(databaseId); + const collectionNode = await explorer.waitForContainerNode(databaseId, collectionId); -// await collectionNode.openContextMenu(); -// await collectionNode.contextMenuItem("Delete Collection").click(); -// await explorer.whilePanelOpen( -// "Delete Collection", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the collection id" }).fill(collectionId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); -// await expect(collectionNode.element).not.toBeAttached(); + await collectionNode.openContextMenu(); + await collectionNode.contextMenuItem("Delete Collection").click(); + await explorer.whilePanelOpen( + "Delete Collection", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the collection id" }).fill(collectionId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); + await expect(collectionNode.element).not.toBeAttached(); -// await databaseNode.openContextMenu(); -// await databaseNode.contextMenuItem("Delete Database").click(); -// await explorer.whilePanelOpen( -// "Delete Database", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the Database id" }).fill(databaseId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + await databaseNode.openContextMenu(); + await databaseNode.contextMenuItem("Delete Database").click(); + await explorer.whilePanelOpen( + "Delete Database", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the Database id" }).fill(databaseId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// await expect(databaseNode.element).not.toBeAttached(); -// }); -// }); + await expect(databaseNode.element).not.toBeAttached(); + }); +}); diff --git a/test/tables/container.spec.ts b/test/tables/container.spec.ts index f5922f7f7..28b8892b4 100644 --- a/test/tables/container.spec.ts +++ b/test/tables/container.spec.ts @@ -1,37 +1,37 @@ -// import { expect, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; -// import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; +import { DataExplorer, TEST_AUTOSCALE_THROUGHPUT_RU, TestAccount, generateUniqueName } from "../fx"; -// test("Tables CRUD", async ({ page }) => { -// test.skip(); -// const tableId = generateUniqueName("table"); // A unique table name IS needed because the database is shared when using Table Storage. +test("Tables CRUD", async ({ page }) => { + test.skip(); + const tableId = generateUniqueName("table"); // A unique table name IS needed because the database is shared when using Table Storage. -// const explorer = await DataExplorer.open(page, TestAccount.Tables); + const explorer = await DataExplorer.open(page, TestAccount.Tables); -// const newTableButton = explorer.frame.getByTestId("GlobalCommands").getByRole("button", { name: "New Table" }); -// await newTableButton.click(); -// await explorer.whilePanelOpen( -// "New Table", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Table id, Example Table1" }).fill(tableId); -// await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + const newTableButton = explorer.frame.getByTestId("GlobalCommands").getByRole("button", { name: "New Table" }); + await newTableButton.click(); + await explorer.whilePanelOpen( + "New Table", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Table id, Example Table1" }).fill(tableId); + await panel.getByTestId("autoscaleRUInput").fill(TEST_AUTOSCALE_THROUGHPUT_RU.toString()); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// const tableNode = await explorer.waitForContainerNode("TablesDB", tableId); + const tableNode = await explorer.waitForContainerNode("TablesDB", tableId); -// await tableNode.openContextMenu(); -// await tableNode.contextMenuItem("Delete Table").click(); -// await explorer.whilePanelOpen( -// "Delete Table", -// async (panel, okButton) => { -// await panel.getByRole("textbox", { name: "Confirm by typing the table id" }).fill(tableId); -// await okButton.click(); -// }, -// { closeTimeout: 5 * 60 * 1000 }, -// ); + await tableNode.openContextMenu(); + await tableNode.contextMenuItem("Delete Table").click(); + await explorer.whilePanelOpen( + "Delete Table", + async (panel, okButton) => { + await panel.getByRole("textbox", { name: "Confirm by typing the table id" }).fill(tableId); + await okButton.click(); + }, + { closeTimeout: 5 * 60 * 1000 }, + ); -// await expect(tableNode.element).not.toBeAttached(); -// }); + await expect(tableNode.element).not.toBeAttached(); +});