From 8f6f5e9368af1a125c0abb62837b792aa8bb2e50 Mon Sep 17 00:00:00 2001 From: Vsevolod Kukol Date: Fri, 11 Sep 2026 22:22:20 +0200 Subject: [PATCH] Stabilize throughput bucket E2E tests --- .../sql/scaleAndSettings/throughputbucket.spec.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/sql/scaleAndSettings/throughputbucket.spec.ts b/test/sql/scaleAndSettings/throughputbucket.spec.ts index 1753c9b2e..095df37c2 100644 --- a/test/sql/scaleAndSettings/throughputbucket.spec.ts +++ b/test/sql/scaleAndSettings/throughputbucket.spec.ts @@ -6,12 +6,11 @@ test.describe("Throughput bucket settings", () => { let context: TestContainerContext = null!; let explorer: DataExplorer = null!; - test.beforeAll("Create Test Database", async () => { + test.beforeEach("Create Test Database", async () => { context = await createTestSQLContainer(); }); - test.beforeEach("Open Throughput Bucket Settings", async ({ browser }) => { - const page = await browser.newPage(); + test.beforeEach("Open Throughput Bucket Settings", async ({ page }) => { explorer = await DataExplorer.open(page, TestAccount.SQL); // 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 if (!process.env.CI) { - test.afterAll("Delete Test Database", async () => { + test.afterEach("Delete Test Database", async () => { await context?.dispose(); }); } @@ -61,12 +60,12 @@ test.describe("Throughput bucket settings", () => { 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(); + await expect(bucket1PercentageInput).toBeDisabled(); // Activate bucket 1 const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle"); await bucket1Toggle.click(); - expect(bucket1PercentageInput).toBeEnabled(); + await expect(bucket1PercentageInput).toBeEnabled(); await bucket1PercentageInput.fill("40"); await explorer.commandBarButton(CommandBarButton.Save).click(); @@ -84,7 +83,7 @@ test.describe("Throughput bucket settings", () => { await defaultThroughputBucketDropdown.click(); const bucket1Option = explorer.frame.getByRole("option", { name: "Bucket 1" }); - expect(bucket1Option).toBeDisabled(); + await expect(bucket1Option).toBeDisabled(); // Activate bucket 1 const bucket1Toggle = explorer.frame.getByTestId("bucket-1-active-toggle"); @@ -92,7 +91,7 @@ test.describe("Throughput bucket settings", () => { // Open dropdown again await defaultThroughputBucketDropdown.click(); - expect(bucket1Option).toBeEnabled(); + await expect(bucket1Option).toBeEnabled(); // Select bucket 1 as default await bucket1Option.click();