Skip to content

Commit 48b978c

Browse files
authored
[CI] Fix flaky API docs E2E test (#2963)
## Summary The API reference E2E test was flaky because it used `waitUntil: 'networkidle'`, which waits for no network activity for 500ms. This condition often never triggers due to analytics scripts, service workers, or background requests - even when the page is fully rendered and functional. This PR switches to `domcontentloaded` for navigation and relies on the element visibility check (`.apiPage`) to determine when the page is ready. This is more reliable because it tests what actually matters: the content being visible to users.
1 parent 07d1b36 commit 48b978c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/docs/site/tests/api-reference.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ test.describe('Docs API reference', () => {
2828
});
2929

3030
await page.goto(apiPath, {
31-
waitUntil: 'networkidle',
31+
waitUntil: 'domcontentloaded',
3232
});
33-
await expect(page.locator('.apiPage')).toBeVisible();
33+
await expect(page.locator('.apiPage')).toBeVisible({ timeout: 30000 });
3434

3535
expect(
3636
pageErrors,

0 commit comments

Comments
 (0)