Skip to content

Commit dab3a6d

Browse files
author
ForgeFlow v2
committed
docs(test): Convert TODO to documentation for DevTools page detection timing
Clarify why 5000ms delay is necessary for DevTools page initialization. Explains the async nature of autoOpenDevTools CLI flag and references upstream Puppeteer issue #14368. Test remains stable; documentation now explains the pattern.
1 parent 7b660b5 commit dab3a6d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/McpContext.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ describe('McpContext', () => {
8989
await withMcpContext(
9090
async (_response, context) => {
9191
const page = await context.newPage();
92-
// TODO: we do not know when the CLI flag to auto open DevTools will run
93-
// so we need this until
94-
// https://github.com/puppeteer/puppeteer/issues/14368 is there.
92+
// Note: DevTools page initialization timing
93+
// The autoOpenDevTools CLI flag launches DevTools asynchronously.
94+
// We wait to ensure Puppeteer has detected and initialized the DevTools page.
95+
// See: https://github.com/puppeteer/puppeteer/issues/14368
96+
// This polling approach is necessary until Puppeteer provides a detection event.
9597
await new Promise(resolve => setTimeout(resolve, 5000));
9698
await context.createPagesSnapshot();
9799
assert.ok(context.getDevToolsPage(page));

0 commit comments

Comments
 (0)