Merge branch 'master' of https://github.com/Azure/cosmos-explorer into users/jawelton/remove-sharedtput-041526

This commit is contained in:
Jade Welton
2026-04-17 14:34:30 -07:00
11 changed files with 392 additions and 130 deletions

View File

@@ -20,7 +20,7 @@ test.describe("Container Copy - Permission Screen Verification", () => {
});
test.afterEach("Cleanup after each test", async () => {
await page.unroute(/.*/, (route) => route.continue());
await page.unrouteAll({ behavior: "ignoreErrors" });
await page.close();
});

View File

@@ -23,7 +23,9 @@ test.describe("Computed Properties", () => {
});
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
if (!process.env.CI) {
await context?.dispose();
}
});
test("Add valid computed property", async ({ page }) => {

View File

@@ -0,0 +1,108 @@
import { expect, test } from "@playwright/test";
import { CommandBarButton, DataExplorer, ONE_MINUTE_MS, TestAccount } from "../../fx";
import { createTestSQLContainer, TestContainerContext } from "../../testData";
test.describe("Throughput bucket settings", () => {
let context: TestContainerContext = null!;
let explorer: DataExplorer = null!;
test.beforeAll("Create Test Database", async () => {
context = await createTestSQLContainer();
});
test.beforeEach("Open Throughput Bucket Settings", async ({ browser }) => {
const page = await browser.newPage();
explorer = await DataExplorer.open(page, TestAccount.SQL);
// Click Scale & Settings and open Throughput Bucket Settings tab
await explorer.openScaleAndSettings(context);
const throughputBucketTab = explorer.frame.getByTestId("settings-tab-header/ThroughputBucketsTab");
await throughputBucketTab.click();
});
// Delete database only if not running in CI
if (!process.env.CI) {
test.afterAll("Delete Test Database", async () => {
await context?.dispose();
});
}
test("Activate throughput bucket #2", async () => {
// Activate bucket 2
const bucket2Toggle = explorer.frame.getByTestId("bucket-2-active-toggle");
await bucket2Toggle.click();
await explorer.commandBarButton(CommandBarButton.Save).click();
await expect(explorer.getConsoleHeaderStatus()).toContainText(
`Successfully updated offer for collection ${context.container.id}`,
{
timeout: 2 * ONE_MINUTE_MS,
},
);
});
test("Activate throughput buckets #1 and #2", async () => {
// Activate bucket 1
const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle");
await bucket1Toggle.click();
// Activate bucket 2
const bucket2Toggle = explorer.frame.getByTestId("bucket-2-active-toggle");
await bucket2Toggle.click();
await explorer.commandBarButton(CommandBarButton.Save).click();
await expect(explorer.getConsoleHeaderStatus()).toContainText(
`Successfully updated offer for collection ${context.container.id}`,
{
timeout: 2 * ONE_MINUTE_MS,
},
);
});
test("Set throughput percentage for bucket #1", async () => {
// Set throughput percentage for bucket 1 (inactive) - Should be disabled
const bucket1PercentageInput = explorer.frame.getByTestId("bucket-1-percentage-input");
expect(bucket1PercentageInput).toBeDisabled();
// Activate bucket 1
const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle");
await bucket1Toggle.click();
expect(bucket1PercentageInput).toBeEnabled();
await bucket1PercentageInput.fill("40");
await explorer.commandBarButton(CommandBarButton.Save).click();
await expect(explorer.getConsoleHeaderStatus()).toContainText(
`Successfully updated offer for collection ${context.container.id}`,
{
timeout: 2 * ONE_MINUTE_MS,
},
);
});
test("Set default throughput bucket", async () => {
// There are no active throughput buckets so they all should be disabled
const defaultThroughputBucketDropdown = explorer.frame.getByTestId("default-throughput-bucket-dropdown");
await defaultThroughputBucketDropdown.click();
const bucket1Option = explorer.frame.getByRole("option", { name: "Bucket 1" });
expect(bucket1Option).toBeDisabled();
// Activate bucket 1
const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle");
await bucket1Toggle.click();
// Open dropdown again
await defaultThroughputBucketDropdown.click();
expect(bucket1Option).toBeEnabled();
// Select bucket 1 as default
await bucket1Option.click();
await explorer.commandBarButton(CommandBarButton.Save).click();
await expect(explorer.getConsoleHeaderStatus()).toContainText(
`Successfully updated offer for collection ${context.container.id}`,
{
timeout: 2 * ONE_MINUTE_MS,
},
);
});
});