-
Notifications
You must be signed in to change notification settings - Fork 1.6k
WebDriver BiDi: support for locating DOM nodes via browsingContext.locateNodes
#46980
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
base: main
Are you sure you want to change the base?
Conversation
…ocateNodes` rdar://137019465 Reviewed by NOBODY (OOPS!). Adding the majority of work for the locateNodes endpoint. The main focus is a need for a new JS script as the classic implementation found as an atom couldn't be modified for the BIDI specification. A current bug with the dispatcher https://bugs.webkit.org/show_bug.cgi?id=294633 has blocked end-to-end testing. The new script was individually tested against a test site, ensuring each type of locator worked. Currently, the callback from evaluateJavaScriptFunction is bare as it's difficult to create a thorough solution without testing. * Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.cpp: (WebKit::BidiBrowsingContextAgent::locateNodes): * Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.h: * Source/WebKit/UIProcess/Automation/protocol/BidiBrowsingContext.json: * Source/WebKit/UIProcess/Automation/protocol/BidiScript.json:
EWS run on current version of this PR (hash 373034c) |
auto page = session->webPageProxyForHandle(context); | ||
ASYNC_FAIL_WITH_PREDEFINED_ERROR_IF(!page, WindowNotFound); | ||
|
||
String locateNodeFunction = R"( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't quite figure out how to move into its own atom file, ended up growing into quite a large string 😞
|
||
session->evaluateJavaScriptFunction(context, emptyString(), locateNodeFunction, *arguments, true, false, callbackTimeout.value(), | ||
[callback = WTFMove(callback)](Inspector::CommandResult<String>&& result) mutable { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think the newlines here are unnecessary
373034c
373034c
🛠 playstation