Skip to content

chore(locator): reimplement waitForFunction via _callOnElementOnceMatches#41611

Merged
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:waitforfunction-on-element
Jul 3, 2026
Merged

chore(locator): reimplement waitForFunction via _callOnElementOnceMatches#41611
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:waitforfunction-on-element

Conversation

@dgozman

@dgozman dgozman commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Base Locator.waitForFunction on a dedicated server method (Frame.waitForFunctionExpressionOnElement) built on _callOnElementOnceMatches, instead of overloading Frame.waitForFunctionExpression.
  • _callOnElementOnceMatches now keeps polling while the callback returns a falsy value; all existing callers wrap their return in { result } so a legitimately-falsy value still resolves immediately.
  • Revert Frame.waitForFunctionExpression to its selector-free form.

…ches

Base Locator.waitForFunction on a dedicated server method built on
_callOnElementOnceMatches instead of overloading waitForFunctionExpression.
_callOnElementOnceMatches now keeps polling while the callback returns a
falsy value; existing callers wrap their return in { result } so a
legitimately-falsy value still resolves immediately.
@dgozman dgozman requested a review from Skn0tt July 3, 2026 11:48
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chromium] › mcp/annotate.spec.ts:110 › should abort annotation when last screenshot is removed @mcp-macos-latest-chromium

7642 passed, 1132 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:434 › should produce network events, routing, and annotations for Service Worker (advanced) `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/heap.spec.ts:223 › should not leak workers `@firefox-ubuntu-22.04-node20`

49496 passed, 1164 skipped


Merge workflow run.

@dgozman dgozman merged commit 9c899cd into microsoft:main Jul 3, 2026
47 of 48 checks passed
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.

2 participants