From b5d831b364aaf1524cfc91a4d333a7ac25d51110 Mon Sep 17 00:00:00 2001 From: counterweight Date: Tue, 23 Dec 2025 12:26:43 +0100 Subject: [PATCH] fix: replace hardcoded wait with explicit wait for loading Replace page.waitForTimeout(1000) with a proper wait for the loading state to disappear. This makes the test more reliable and faster. --- frontend/e2e/exchange.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/e2e/exchange.spec.ts b/frontend/e2e/exchange.spec.ts index 4efc648..e9ef278 100644 --- a/frontend/e2e/exchange.spec.ts +++ b/frontend/e2e/exchange.spec.ts @@ -250,8 +250,8 @@ test.describe("Trades Page", () => { test("trades page shows Start trading link when empty", async ({ page }) => { await page.goto("/trades"); - // Wait for content to load - await page.waitForTimeout(1000); + // Wait for loading to finish - either "Loading trades..." disappears or we see content + await expect(page.getByText("Loading trades...")).not.toBeVisible({ timeout: 5000 }); // Check if it shows empty state with link, or trades exist const startTradingLink = page.getByRole("link", { name: "Start trading" });