mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 20:17:03 +00:00
* Temporarily re-enable key based auth for Mongo and Cassandra tests. * Increase number of shards for playwright tests. * Another small bump to test shard count. * click global new... button then collection in playwright tests * get new table button * create and delete container for every individual scale test * for scale and settings, dont create sample data in container * run scale tests serially * refactor scale setup and tear down to be within each test * record network traces * record network calls on all retries * when disposing of database during playwright test, refresh tree to remove deleted database * refresh tree before opening scale and settings * When opening scale and settings, refresh databases * reload all databases before loading offers * increase time for change partition key request * increase time for change partition key request * refresh databases in test instead of product code * when refreshing containers, open console window to check for status completion * close notification console window after seeing desired log * create and delete a container for each individual test * dont delete database after every test. leave it to the CI * Don't refresh databases when opening Scale+Settings and only delete database if running locally * only open scale and settings at the beginning of each test suite * get it back to working * change settings.spect.ts from serial to parallel * don't delete database after each test * update container creation throughpout to be 5000 * run tests with no throughput limit on the account * adjust scale test to reflect no throughput limit on account * remove test container throughput * don't refresh collections when clicking settings in product code * refactor and run cleanup during pr check * copy cleanup accounts * run cleanup after playwright tests * run cleanup every three hours * revert ci.yml * update cpk test * remove cpk * remove cleanup accounts and add cpk * add cpk * remove cpk changes * revert ci.yml * run cleanup every two hours --------- Co-authored-by: Jade Welton <jawelton@microsoft.com> Co-authored-by: Asier Isayas <aisayas@microsoft.com>
60 lines
2.3 KiB
TypeScript
60 lines
2.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
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 }) => {
|
|
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 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);
|
|
|
|
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 expect(databaseNode.element).not.toBeAttached();
|
|
});
|
|
});
|