fix: ensure page stability after project creation by waiting for network to be idle

This commit is contained in:
Nawaz Dhandala
2026-04-02 09:02:44 +01:00
parent 4bdf9943e4
commit 4e33cd7c1b

View File

@@ -83,6 +83,10 @@ test.describe("Monitor Creation", () => {
timeout: 30000,
});
// Wait for the page to fully settle after project creation
// The app may perform internal redirects after project setup
await page.waitForLoadState("networkidle");
// Extract the project ID from the URL
const projectUrl: string = page.url();
const projectIdMatch: RegExpMatchArray | null = projectUrl.match(
@@ -96,6 +100,7 @@ test.describe("Monitor Creation", () => {
URL.fromString(BASE_URL.toString())
.addRoute(`/dashboard/${projectId}/monitors/create`)
.toString(),
{ waitUntil: "networkidle" },
);
// Wait for the create monitor form to load