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.
This commit is contained in:
parent
06ad7fefe1
commit
b5d831b364
1 changed files with 2 additions and 2 deletions
|
|
@ -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" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue