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:
@@ -17,10 +17,10 @@ test("JobHistory shows jobs and job detail navigates", async ({ page }) => {
|
|||||||
const jobId = body.jobId || body.job?.id;
|
const jobId = body.jobId || body.job?.id;
|
||||||
expect(jobId).toBeTruthy();
|
expect(jobId).toBeTruthy();
|
||||||
|
|
||||||
// Navigate to stock detail page by clicking the symbol link (avoids aborted navigations)
|
// Navigate to stock detail page directly (use absolute URL to avoid SPA navigation races)
|
||||||
const symbolLink = firstRow.locator('td a');
|
const base = new URL(page.url()).origin;
|
||||||
await symbolLink.click();
|
await page.goto(`${base}/stocks/${ticker}`, { waitUntil: 'load', timeout: 20000 });
|
||||||
await page.waitForURL(new RegExp(`/stocks/${ticker}`), { timeout: 10000 });
|
await page.waitForSelector('text=Job History', { timeout: 10000 });
|
||||||
|
|
||||||
// Wait up to 10s for JobHistory to show at least one job
|
// Wait up to 10s for JobHistory to show at least one job
|
||||||
await page.waitForSelector('text=Job History', { timeout: 10000 });
|
await page.waitForSelector('text=Job History', { timeout: 10000 });
|
||||||
|
|||||||
Reference in New Issue
Block a user