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>

This commit is contained in:
2026-05-16 20:24:48 +02:00
parent 18173f9905
commit 9aefcc04b8
+4 -4
View File
@@ -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 });