Skip to content

Commit 1a50924

Browse files
committed
fix(e2e): stabilize personal project reload smoke
1 parent bb43e9f commit 1a50924

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

e2e/ui/project-management-flows.test.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,11 @@ test('[P0] UI-created Personal project recovers preview and write authority afte
326326
await mockWritablePersonalProjectScope(page);
327327
await stubCatalogsEmpty(page);
328328

329-
await page.goto('/');
329+
// Start on the destination route. Driving the client router while the
330+
// dynamic App tree is still mounting can be overwritten by its initial `/`
331+
// snapshot, leaving openNewProjectModal waiting on a navigation that the
332+
// booting app just reverted.
333+
await page.goto('/projects', { waitUntil: 'domcontentloaded' });
330334
await openNewProjectModal(page);
331335
await page.getByTestId('new-project-tab-prototype').click();
332336
await page.getByTestId('new-project-name').fill('Reloaded Personal authority');
@@ -395,8 +399,19 @@ test('[P0] UI-created Personal project recovers preview and write authority afte
395399
// back to `.viewer-loading`. That skeleton is only reachable in the sub-100ms
396400
// window before `/api/workspace/context` answers, which makes it a race, not
397401
// a contract. Reads stay open; only writes fail closed.
402+
// The scope request is deliberately held above, so the route bootstrap
403+
// cannot mount ProjectView by itself. Wait for the independent project-list
404+
// read that supplies the persisted row instead of racing it with the
405+
// locator's default timeout on a cold CI worker.
406+
const projectListLoaded = page.waitForResponse((response) => {
407+
const url = new URL(response.url());
408+
return response.request().method() === 'GET'
409+
&& url.pathname === '/api/projects'
410+
&& response.ok();
411+
}, { timeout: T.long });
398412
await page.reload({ waitUntil: 'domcontentloaded' });
399-
await expect(page.getByTestId('file-workspace')).toBeVisible();
413+
await projectListLoaded;
414+
await expect(page.getByTestId('file-workspace')).toBeVisible({ timeout: T.long });
400415
await expect(page.getByTestId('chat-composer-input')).toHaveAttribute('aria-readonly', 'true');
401416

402417
releaseScope();

0 commit comments

Comments
 (0)