mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
WebDriver+Browser: Implement POST /session/{id}/window/rect
This commit is contained in:
parent
dac91c5790
commit
174248678e
7 changed files with 119 additions and 0 deletions
|
@ -37,6 +37,7 @@ Vector<Client::Route> Client::s_routes = {
|
|||
{ HTTP::HttpRequest::Method::DELETE, { "session", ":session_id", "window" }, &Client::handle_close_window },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "window", "handles" }, &Client::handle_get_window_handles },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "window", "rect" }, &Client::handle_get_window_rect },
|
||||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "window", "rect" }, &Client::handle_set_window_rect },
|
||||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "element" }, &Client::handle_find_element },
|
||||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "elements" }, &Client::handle_find_elements },
|
||||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "element", ":element_id", "element" }, &Client::handle_find_element_from_element },
|
||||
|
@ -554,6 +555,16 @@ ErrorOr<JsonValue, WebDriverError> Client::handle_get_window_rect(Vector<StringV
|
|||
return make_json_value(result);
|
||||
}
|
||||
|
||||
// 11.8.2 Set Window Rect, https://w3c.github.io/webdriver/#dfn-set-window-rect
|
||||
// POST /session/{session id}/window/rect
|
||||
ErrorOr<JsonValue, WebDriverError> Client::handle_set_window_rect(Vector<StringView> const& parameters, JsonValue const& payload)
|
||||
{
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/window/rect");
|
||||
auto* session = TRY(find_session_with_id(parameters[0]));
|
||||
auto result = TRY(session->set_window_rect(payload));
|
||||
return make_json_value(result);
|
||||
}
|
||||
|
||||
// 12.3.2 Find Element, https://w3c.github.io/webdriver/#dfn-find-element
|
||||
// POST /session/{session id}/element
|
||||
ErrorOr<JsonValue, WebDriverError> Client::handle_find_element(Vector<StringView> const& parameters, JsonValue const& payload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue