Skip to content

chore(snapshot for ai): add timeout to limit waiting for iframes #36712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2025

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Jul 18, 2025

Bug reported via #36710, here's an alternative solution.

Skn0tt and others added 2 commits July 18, 2025 14:04
Co-Authored-By: ogadra <61941819+ogadra@users.noreply.github.com>
Copy link
Contributor

@ogadra ogadra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach resolves the issue. Thanks for the commit!

  1. It seems that the test is failing due to a timeout error from snapshotForAI. Instead of throwing an error upon timeout, I'd prefer it to return an empty element.

  2. Once this is merged, I'd like to have the option to configure the timeout value in the Playwright MCP config file.

await page.waitForSelector('iframe');

// Get the snapshot of the page
const snapshot = await snapshotForAI(page, { timeout: 100 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test will fail because Playwright tests have a default timeout of 30 seconds. You might want to set the timeout value to less than 30 seconds.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 100ms, so there's enough time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My previous comment was off the mark—sorry about that.

@Skn0tt Skn0tt requested a review from dgozman July 18, 2025 12:31
Copy link
Contributor

Test results for "tests 1"

5 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node18-1
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node24-1
⚠️ [webkit-library] › library/browsercontext-pages.spec.ts:105:3 › should return bounding box with page scale @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

46762 passed, 926 skipped
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants