mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
WebDriver: Implement GET /session/{id}/element/{id}/css/{name}
This commit is contained in:
parent
202b2be1f2
commit
354a845d65
7 changed files with 73 additions and 0 deletions
|
@ -42,6 +42,7 @@ Vector<Client::Route> Client::s_routes = {
|
|||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "element", ":element_id", "elements" }, &Client::handle_find_elements_from_element },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "element", ":element_id", "attribute", ":name" }, &Client::handle_get_element_attribute },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "element", ":element_id", "property", ":name" }, &Client::handle_get_element_property },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "element", ":element_id", "css", ":property_name" }, &Client::handle_get_element_css_value },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "cookie" }, &Client::handle_get_all_cookies },
|
||||
{ HTTP::HttpRequest::Method::GET, { "session", ":session_id", "cookie", ":name" }, &Client::handle_get_named_cookie },
|
||||
{ HTTP::HttpRequest::Method::POST, { "session", ":session_id", "cookie" }, &Client::handle_add_cookie },
|
||||
|
@ -601,6 +602,16 @@ ErrorOr<JsonValue, HttpError> Client::handle_get_element_property(Vector<StringV
|
|||
return make_json_value(result);
|
||||
}
|
||||
|
||||
// 12.4.4 Get Element CSS Value, https://w3c.github.io/webdriver/#dfn-get-element-css-value
|
||||
// GET /session/{session id}/element/{element id}/css/{property name}
|
||||
ErrorOr<JsonValue, HttpError> Client::handle_get_element_css_value(Vector<StringView> const& parameters, JsonValue const& payload)
|
||||
{
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/element/<element_id>/css/<property_name>");
|
||||
auto* session = TRY(find_session_with_id(parameters[0]));
|
||||
auto result = TRY(session->get_element_css_value(payload, parameters[1], parameters[2]));
|
||||
return make_json_value(result);
|
||||
}
|
||||
|
||||
// 14.1 Get All Cookies, https://w3c.github.io/webdriver/#dfn-get-all-cookies
|
||||
// GET /session/{session id}/cookie
|
||||
ErrorOr<JsonValue, HttpError> Client::handle_get_all_cookies(Vector<StringView> const& parameters, JsonValue const&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue