Stabilize throughput bucket E2E tests

This commit is contained in:
Vsevolod Kukol
2026-09-11 22:22:20 +02:00
parent b16229d1f8
commit 8f6f5e9368
@@ -6,12 +6,11 @@ test.describe("Throughput bucket settings", () => {
let context: TestContainerContext = null!; let context: TestContainerContext = null!;
let explorer: DataExplorer = null!; let explorer: DataExplorer = null!;
test.beforeAll("Create Test Database", async () => { test.beforeEach("Create Test Database", async () => {
context = await createTestSQLContainer(); context = await createTestSQLContainer();
}); });
test.beforeEach("Open Throughput Bucket Settings", async ({ browser }) => { test.beforeEach("Open Throughput Bucket Settings", async ({ page }) => {
const page = await browser.newPage();
explorer = await DataExplorer.open(page, TestAccount.SQL); explorer = await DataExplorer.open(page, TestAccount.SQL);
// Click Scale & Settings and open Throughput Bucket Settings tab // Click Scale & Settings and open Throughput Bucket Settings tab
@@ -22,7 +21,7 @@ test.describe("Throughput bucket settings", () => {
// Delete database only if not running in CI // Delete database only if not running in CI
if (!process.env.CI) { if (!process.env.CI) {
test.afterAll("Delete Test Database", async () => { test.afterEach("Delete Test Database", async () => {
await context?.dispose(); await context?.dispose();
}); });
} }
@@ -61,12 +60,12 @@ test.describe("Throughput bucket settings", () => {
test("Set throughput percentage for bucket #1", async () => { test("Set throughput percentage for bucket #1", async () => {
// Set throughput percentage for bucket 1 (inactive) - Should be disabled // Set throughput percentage for bucket 1 (inactive) - Should be disabled
const bucket1PercentageInput = explorer.frame.getByTestId("bucket-1-percentage-input"); const bucket1PercentageInput = explorer.frame.getByTestId("bucket-1-percentage-input");
expect(bucket1PercentageInput).toBeDisabled(); await expect(bucket1PercentageInput).toBeDisabled();
// Activate bucket 1 // Activate bucket 1
const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle"); const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle");
await bucket1Toggle.click(); await bucket1Toggle.click();
expect(bucket1PercentageInput).toBeEnabled(); await expect(bucket1PercentageInput).toBeEnabled();
await bucket1PercentageInput.fill("40"); await bucket1PercentageInput.fill("40");
await explorer.commandBarButton(CommandBarButton.Save).click(); await explorer.commandBarButton(CommandBarButton.Save).click();
@@ -84,7 +83,7 @@ test.describe("Throughput bucket settings", () => {
await defaultThroughputBucketDropdown.click(); await defaultThroughputBucketDropdown.click();
const bucket1Option = explorer.frame.getByRole("option", { name: "Bucket 1" }); const bucket1Option = explorer.frame.getByRole("option", { name: "Bucket 1" });
expect(bucket1Option).toBeDisabled(); await expect(bucket1Option).toBeDisabled();
// Activate bucket 1 // Activate bucket 1
const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle"); const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle");
@@ -92,7 +91,7 @@ test.describe("Throughput bucket settings", () => {
// Open dropdown again // Open dropdown again
await defaultThroughputBucketDropdown.click(); await defaultThroughputBucketDropdown.click();
expect(bucket1Option).toBeEnabled(); await expect(bucket1Option).toBeEnabled();
// Select bucket 1 as default // Select bucket 1 as default
await bucket1Option.click(); await bucket1Option.click();