From 9aefcc04b80b54ec4e5a57c6f98443dfe2a21d36 Mon Sep 17 00:00:00 2001 From: Henry Winkel Date: Sat, 16 May 2026 20:24:48 +0200 Subject: [PATCH] test(e2e): robust navigate to stock detail via absolute URL to avoid SPA races\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/job-history.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/job-history.spec.ts b/tests/job-history.spec.ts index aaa3c75..5484069 100644 --- a/tests/job-history.spec.ts +++ b/tests/job-history.spec.ts @@ -17,10 +17,10 @@ test("JobHistory shows jobs and job detail navigates", async ({ page }) => { const jobId = body.jobId || body.job?.id; expect(jobId).toBeTruthy(); - // Navigate to stock detail page by clicking the symbol link (avoids aborted navigations) - const symbolLink = firstRow.locator('td a'); - await symbolLink.click(); - await page.waitForURL(new RegExp(`/stocks/${ticker}`), { timeout: 10000 }); + // Navigate to stock detail page directly (use absolute URL to avoid SPA navigation races) + const base = new URL(page.url()).origin; + await page.goto(`${base}/stocks/${ticker}`, { waitUntil: 'load', timeout: 20000 }); + await page.waitForSelector('text=Job History', { timeout: 10000 }); // Wait up to 10s for JobHistory to show at least one job await page.waitForSelector('text=Job History', { timeout: 10000 });