From dd243612b80c9552a3806094316ec3a665db44d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 26 Feb 2026 13:17:09 -0600 Subject: [PATCH] Make specs less flaky --- tests/e2e/repo.spec.ts | 1 + tests/e2e/repo/commits.spec.ts | 1 + tests/e2e/repo/issues.spec.ts | 1 + tests/e2e/repo/patch.spec.ts | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/tests/e2e/repo.spec.ts b/tests/e2e/repo.spec.ts index cd852cc02..71c58fc65 100644 --- a/tests/e2e/repo.spec.ts +++ b/tests/e2e/repo.spec.ts @@ -64,6 +64,7 @@ test("repo description", async ({ page, peer }) => { description: "Radicle Heartwood Protocol & Stack", }); await page.goto(peer.ridUrl(rid)); + await page.waitForLoadState("networkidle"); await expect( page.getByText("Radicle Heartwood Protocol & Stack"), ).toBeVisible(); diff --git a/tests/e2e/repo/commits.spec.ts b/tests/e2e/repo/commits.spec.ts index 304bb3430..e07e42e1a 100644 --- a/tests/e2e/repo/commits.spec.ts +++ b/tests/e2e/repo/commits.spec.ts @@ -131,6 +131,7 @@ test("commit messages with double colon not converted into single colon", async test("expand commit message", async ({ page }) => { await page.goto(sourceBrowsingUrl); + await page.waitForLoadState("networkidle"); await page .getByRole("link", { name: `Commits ${aliceMainCommitCount}` }) .click(); diff --git a/tests/e2e/repo/issues.spec.ts b/tests/e2e/repo/issues.spec.ts index d6a5baece..7df147fd2 100644 --- a/tests/e2e/repo/issues.spec.ts +++ b/tests/e2e/repo/issues.spec.ts @@ -3,6 +3,7 @@ import { createRepo } from "@tests/support/repo"; test("navigate issue listing", async ({ page }) => { await page.goto(cobUrl); + await page.waitForLoadState("networkidle"); await page.getByRole("link", { name: "Issues 1" }).click(); await expect(page).toHaveURL(`${cobUrl}/issues`); diff --git a/tests/e2e/repo/patch.spec.ts b/tests/e2e/repo/patch.spec.ts index 446a84d43..a255031d8 100644 --- a/tests/e2e/repo/patch.spec.ts +++ b/tests/e2e/repo/patch.spec.ts @@ -7,6 +7,7 @@ test("navigate patch details", async ({ page }) => { await page.getByRole("link", { name: "Add subtitle to README" }).click(); await expect(page).toHaveURL(/commits\/[a-f0-9]{40}$/); await page.goBack(); + await page.waitForLoadState("networkidle"); await page.getByRole("link", { name: "Changes" }).click(); await expect(page).toHaveURL(/patches\/[a-f0-9]{40}\?tab=changes$/); }); @@ -77,6 +78,7 @@ test("navigate through revision diffs", async ({ page }) => { /patches\/[a-f0-9]{40}\?diff=38c225e2a0b47ba59def211f4e4825c31d9463ec\.\.9e4feab1b2123dfa5f22bd0e4656060ec9296638$/, ); await page.goBack(); + await page.waitForLoadState("networkidle"); await secondRevision .getByRole("button", { name: "toggle-context-menu" }) .first() @@ -94,6 +96,7 @@ test("navigate through revision diffs", async ({ page }) => { /patches\/[a-f0-9]{40}\?diff=88b7fd90389c1a629f91ed7bf838d4b947426622\.\.9e4feab1b2123dfa5f22bd0e4656060ec9296638$/, ); await page.goBack(); + await page.waitForLoadState("networkidle"); } // First revision and DiffStatBadge shortcut. { @@ -141,6 +144,7 @@ test("commit listing ordering keeping stable on browser navigation", async ({ await expectCorrectCommitListing(); await page.getByRole("link", { name: "Rewrite subtitle to README" }).click(); await page.goBack(); + await page.waitForLoadState("networkidle"); await page .getByRole("heading", { name: "Taking another stab at the README" }) .waitFor();