diff --git a/Userland/Services/WebContent/WebDriverClient.ipc b/Userland/Services/WebContent/WebDriverClient.ipc index 9b2f3b501c..d54d023f4f 100644 --- a/Userland/Services/WebContent/WebDriverClient.ipc +++ b/Userland/Services/WebContent/WebDriverClient.ipc @@ -47,7 +47,7 @@ endpoint WebDriverClient { get_computed_label(String element_id) => (Web::WebDriver::Response response) element_click(String element_id) => (Web::WebDriver::Response response) element_clear(String element_id) => (Web::WebDriver::Response response) - element_send_keys(String element_id) => (Web::WebDriver::Response response) + element_send_keys(String element_id, JsonValue payload) => (Web::WebDriver::Response response) get_source() => (Web::WebDriver::Response response) execute_script(JsonValue payload) => (Web::WebDriver::Response response) execute_async_script(JsonValue payload) => (Web::WebDriver::Response response) @@ -56,7 +56,7 @@ endpoint WebDriverClient { add_cookie(JsonValue payload) => (Web::WebDriver::Response response) delete_cookie(String name) => (Web::WebDriver::Response response) delete_all_cookies() => (Web::WebDriver::Response response) - perform_actions() => (Web::WebDriver::Response response) + perform_actions(JsonValue payload) => (Web::WebDriver::Response response) release_actions() => (Web::WebDriver::Response response) dismiss_alert() => (Web::WebDriver::Response response) accept_alert() => (Web::WebDriver::Response response) @@ -64,6 +64,6 @@ endpoint WebDriverClient { send_alert_text(JsonValue payload) => (Web::WebDriver::Response response) take_screenshot() => (Web::WebDriver::Response response) take_element_screenshot(String element_id) => (Web::WebDriver::Response response) - print_page() => (Web::WebDriver::Response response) + print_page(JsonValue payload) => (Web::WebDriver::Response response) ensure_top_level_browsing_context_is_open() => (Web::WebDriver::Response response) } diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index a6e7f1f6e4..8f762c90de 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -1349,7 +1349,6 @@ Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_cli return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnknownError, scroll_or_error.error().string_literal()); // FIXME: 6. If element’s container is still not in view, return error with error code element not interactable. - // FIXME: 7. If element’s container is obscured by another element, return error with error code element click intercepted. // 8. Matching on element: @@ -1403,38 +1402,24 @@ Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_cli } // -> Otherwise else { + dbgln("FIXME: WebDriverConnection::element_click({})", element->class_name()); + // FIXME: 1. Let input state be the result of get the input state given current session and current top-level browsing context. - // FIXME: 2. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. - // FIXME: 3. Let input id be a the result of generating a UUID. - // FIXME: 4. Let source be the result of create an input source with input state, and "pointer". - // FIXME: 5. Add an input source with input state, input id and source. - // FIXME: 6. Let click point be the element’s in-view center point. - // FIXME: 7. Let pointer move action be an action object constructed with arguments input id, "pointer", and "pointerMove". - // FIXME: 8. Set a property x to 0 on pointer move action. - // FIXME: 9. Set a property y to 0 on pointer move action. - // FIXME: 10. Set a property origin to element on pointer move action. - // FIXME: 11. Let pointer down action be an action object constructed with arguments input id, "pointer", and "pointerDown". - // FIXME: 12. Set a property button to 0 on pointer down action. - // FIXME: 13. Let pointer up action be an action object constructed with arguments input id, "mouse", and "pointerUp" as arguments. - // FIXME: 14. Set a property button to 0 on pointer up action. - // FIXME: 15. Let actions be the list «pointer move action, pointer down action, pointer move action». - // FIXME: 16. Dispatch a list of actions with input state, actions, current browsing context, and actions options. - // FIXME: 17. Remove an input source with input state and input id. } @@ -1448,305 +1433,208 @@ Messages::WebDriverClient::ElementClickResponse WebDriverConnection::element_cli } // 12.5.2 Element Clear, https://w3c.github.io/webdriver/#dfn-element-clear -Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_clear(String const&) +Messages::WebDriverClient::ElementClearResponse WebDriverConnection::element_clear(String const& element_id) { - dbgln("FIXME: WebDriverConnection::element_clear()"); - - // FIXME: 1. If element's innerHTML IDL attribute is an empty string do nothing and return. - - // FIXME: 2. Run the focusing steps for element. - - // FIXME: 3. Set element's innerHTML IDL attribute to an empty string. - - // FIXME: 4. Run the unfocusing steps for the element. - - // To clear a resettable element: - - // FIXME: 1. Let empty be the result of the first matching condition: + dbgln("FIXME: WebDriverConnection::element_clear({})", element_id); + // To clear a content editable element: { - // -> element is an input element whose type attribute is in the File Upload state - // True if the list of selected files has a length of 0, and false otherwise. - // -> otherwise - // True if its value IDL attribute is an empty string, and false otherwise. + // FIXME: 1. If element's innerHTML IDL attribute is an empty string do nothing and return. + // FIXME: 2. Run the focusing steps for element. + // FIXME: 3. Set element's innerHTML IDL attribute to an empty string. + // FIXME: 4. Run the unfocusing steps for the element. } - // FIXME: 2. If element is a candidate for constraint validation it satisfies its constraints, and empty is true, abort these substeps. - - // FIXME: 3. Invoke the focusing steps for element. - - // FIXME: 4. Invoke the clear algorithm for element. - - // FIXME: 5. Invoke the unfocusing steps for the element. - - // The remote end steps, given session, URL variables and parameters are: + // To clear a resettable element: + { + // FIXME: 1. Let empty be the result of the first matching condition: + { + // -> element is an input element whose type attribute is in the File Upload state + { + // True if the list of selected files has a length of 0, and false otherwise. + } + // -> otherwise + { + // True if its value IDL attribute is an empty string, and false otherwise. + } + } + // FIXME: 2. If element is a candidate for constraint validation it satisfies its constraints, and empty is true, abort these substeps. + // FIXME: 3. Invoke the focusing steps for element. + // FIXME: 4. Invoke the clear algorithm for element. + // FIXME: 5. Invoke the unfocusing steps for the element. + } // FIXME: 1. If session's current browsing context is no longer open, return error with error code no such window. - // FIXME: 2. Try to handle any user prompts with session. - // FIXME: 3. Let element be the result of trying to get a known element with session and element id. - // FIXME: 4. If element is not editable, return an error with error code invalid element state. - // FIXME: 5. Scroll into view the element. - // FIXME: 6. Let timeout be session's session timeouts' implicit wait timeout. - // FIXME: 7. Let timer be a new timer. - // FIXME: 8. If timeout is not null: - { // FIXME: 1. Start the timer with timer and timeout. } - // FIXME: 9. Wait for element to become interactable, or timer's timeout fired flag to be set, whichever occurs first. - // FIXME: 10. If element is not interactable, return error with error code element not interactable. - // FIXME: 11. Run the substeps of the first matching statement: - { // -> element is a mutable form control element - - // Invoke the steps to clear a resettable element. - + { + // Invoke the steps to clear a resettable element. + } // -> element is a mutable element - - // Invoke the steps to clear a content editable element. - + { + // Invoke the steps to clear a content editable element. + } // -> otherwise - - // Return error with error code invalid element state. + { + // Return error with error code invalid element state. + } } - // FIXME: 12. Return success with data null. return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "element clear not implemented"sv); } // 12.5.3 Element Send Keys, https://w3c.github.io/webdriver/#dfn-element-send-keys -Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_send_keys(String const&) +Messages::WebDriverClient::ElementSendKeysResponse WebDriverConnection::element_send_keys(String const& element_id, JsonValue const& payload) { - dbgln("FIXME: WebDriverConnection::element_send_keys()"); - - // FIXME: 1. If source is not a key input source return error with error code invalid argument. - - // FIXME: 2. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. - - // FIXME: 3. For each entry key in the lexically sorted keys of undo actions: + dbgln("FIXME: WebDriverConnection::element_send_keys({}, {})", element_id, payload); + // To clear the modifier key state given input state, input id, source, undo actions, and browsing context: { - // FIXME: 1. Let action be the value of undo actions equal to the key entry key. - - // FIXME: 2. If action is not an action object with type "key" and subtype "keyUp", return error with error code invalid argument. - - // FIXME: 3. Let actions be the list «action» - - // FIXME: 4. Dispatch a list of actions with input state, actions, browsing context, and actions options. + // FIXME: 1. If source is not a key input source return error with error code invalid argument. + // FIXME: 2. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. + // FIXME: 3. For each entry key in the lexically sorted keys of undo actions: + { + // FIXME: 1. Let action be the value of undo actions equal to the key entry key. + // FIXME: 2. If action is not an action object with type "key" and subtype "keyUp", return error with error code invalid argument. + // FIXME: 3. Let actions be the list «action» + // FIXME: 4. Dispatch a list of actions with input state, actions, browsing context, and actions options. + } } // To dispatch the events for a typeable string given input state, input id, source, text, and browsing context: - - // FIXME: 1. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. - - // FIXME: 2. For each char of text: - { - // FIXME: 1. Let global key state be the result of get the global key state with input state. - - // FIXME: 2. Let actions be the list «action». - - // FIXME: 3. Dispatch a list of actions with input state, actions, and browsing context. + // FIXME: 1. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. + // FIXME: 2. For each char of text: + { + // FIXME: 1. Let global key state be the result of get the global key state with input state. + // FIXME: 2. Let actions be the list «action». + // FIXME: 3. Dispatch a list of actions with input state, actions, and browsing context. + } + // FIXME: 3. If char is not a shifted character and the shifted state of source is true: + { + // FIXME: 1. Let action be an action object constructed with input id, "key", and "keyUp", and set its value property to U+E008 ("left shift"). + // FIXME: 2. Let tick actions be the list «action». + // FIXME: 3. Dispatch a list of actions with input state, actions, browsing context, and actions options. + } + // FIXME: 4. Let keydown action be an action object constructed with arguments input id, "key", and "keyDown". + // FIXME: 5. Set the value property of keydown action to char. + // FIXME: 6. Let keyup action be a copy of keydown action with the subtype property changed to "keyUp". + // FIXME: 7. Let actions be the list «keydown action, keyup action». + // FIXME: 8. Dispatch a list of actions with input state, actions, browsing context, and actions options. } - // FIXME: 3. If char is not a shifted character and the shifted state of source is true: - - { - // FIXME: 1. Let action be an action object constructed with input id, "key", and "keyUp", and set its value property to U+E008 ("left shift"). - - // FIXME: 2. Let tick actions be the list «action». - - // FIXME: 3. Dispatch a list of actions with input state, actions, browsing context, and actions options. - } - - // FIXME: 4. Let keydown action be an action object constructed with arguments input id, "key", and "keyDown". - - // FIXME: 5. Set the value property of keydown action to char. - - // FIXME: 6. Let keyup action be a copy of keydown action with the subtype property changed to "keyUp". - - // FIXME: 7. Let actions be the list «keydown action, keyup action». - - // FIXME: 8. Dispatch a list of actions with input state, actions, browsing context, and actions options. - // To dispatch actions for a string given input state, input id, source, text, browsing context, and actions options: - - // FIXME: 1. Let clusters be an array created by breaking text into extended grapheme clusters. - - // FIXME: 2. Let undo actions be an empty map. - - // FIXME: 3. Let current typeable text be an empty list. - - // FIXME: 4. For each cluster corresponding to an indexed property in clusters run the substeps of the first matching statement: - { - // -> cluster is the null key - + // FIXME: 1. Let clusters be an array created by breaking text into extended grapheme clusters. + // FIXME: 2. Let undo actions be an empty map. + // FIXME: 3. Let current typeable text be an empty list. + // FIXME: 4. For each cluster corresponding to an indexed property in clusters run the substeps of the first matching statement: { - // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. Empty current typeable text. - - // FIXME: 2. Try to clear the modifier key state with input state, input id, source, undo actions and browsing context. - - // FIXME: 3. Clear undo actions. - } - - // -> cluster is a modifier key - - { - // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. - - // FIXME: 2. Emptycurrent typeable text. - - // FIXME: 3. Let keydown action be an action object constructed with arguments input id, "key", and "keyDown". - - // FIXME: 4. Set the value property of keydown action to cluster. - - // FIXME: 5. Let actions be the list «keydown action» - - // FIXME: 6. Dispatch a list of actions with input state, actions, browsing context, and actions options. - - // FIXME: 7. Add an entry to undo actions with key cluster and value being a copy of keydown action with the subtype property modified to "keyUp". - } - - // -> cluster is typeable - - { - // Append cluster to current typeable text. - } - - // -> otherwise - - { - // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. - - // FIXME: 2. Empty current typeable text. - - // FIXME: 3. Dispatch a composition event with arguments "compositionstart", undefined, and browsing context. - - // FIXME: 4. Dispatch a composition event with arguments "compositionupdate", cluster, and browsing context. - - // FIXME: 5. Dispatch a composition event with arguments "compositionend", cluster, and browsing context. + // -> cluster is the null key + { + // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. Empty current typeable text. + // FIXME: 2. Try to clear the modifier key state with input state, input id, source, undo actions and browsing context. + // FIXME: 3. Clear undo actions. + } + // -> cluster is a modifier key + { + // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. + // FIXME: 2. Emptycurrent typeable text. + // FIXME: 3. Let keydown action be an action object constructed with arguments input id, "key", and "keyDown". + // FIXME: 4. Set the value property of keydown action to cluster. + // FIXME: 5. Let actions be the list «keydown action» + // FIXME: 6. Dispatch a list of actions with input state, actions, browsing context, and actions options. + // FIXME: 7. Add an entry to undo actions with key cluster and value being a copy of keydown action with the subtype property modified to "keyUp". + } + // -> cluster is typeable + { + // Append cluster to current typeable text. + } + // -> otherwise + { + // FIXME: 1. Dispatch the events for a typeable string with input state, input id, source, current typeable text, and browsing context. + // FIXME: 2. Empty current typeable text. + // FIXME: 3. Dispatch a composition event with arguments "compositionstart", undefined, and browsing context. + // FIXME: 4. Dispatch a composition event with arguments "compositionupdate", cluster, and browsing context. + // FIXME: 5. Dispatch a composition event with arguments "compositionend", cluster, and browsing context. + } } + // FIXME: 5. Dispatch the events for a typeable string with input state, input id and source, current typeable text, and browsing context. + // FIXME: 6. Try to clear the modifier key state with input state, input id, source, undo actions, and browsing context. } - // FIXME: 5. Dispatch the events for a typeable string with input state, input id and source, current typeable text, and browsing context. - - // FIXME: 6. Try to clear the modifier key state with input state, input id, source, undo actions, and browsing context. - - // The remote end steps, given session, URL variables and parameters are: - // FIXME: 1. Let text be the result of getting a property named "text" from parameters. - // FIXME: 2. If text is not a String, return an error with error code invalid argument. - // FIXME: 3. If session's current browsing context is no longer open, return error with error code no such window. - // FIXME: 4. Try to handle any user prompts with session. - // FIXME: 5. Let element be the result of trying to get a known element with session and URL variables[element id]. - // FIXME: 6. Let file be true if element is input element in the file upload state, or false otherwise. - // FIXME: 7. If file is false or the session's strict file interactability, is true run the following substeps: - { // FIXME: 1. Scroll into view the element. - // FIXME: 2. Let timeout be session's session timeouts' implicit wait timeout. - // FIXME: 3. Let timer be a new timer. - // FIXME: 4. If timeout is not null: - { // FIXME: 1. Start the timer with timer and timeout. } - // FIXME: 5. Wait for element to become keyboard-interactable, or timer's timeout fired flag to be set, whichever occurs first. - // FIXME: 6. If element is not keyboard-interactable, return error with error code element not interactable. - // FIXME: 7. If element is not the active element run the focusing steps for the element. } - // FIXME: 8. Run the substeps of the first matching condition: - - // -> file is true - { - // FIXME: 1. Let files be the result of splitting text on the newline (\n) character. - - // FIXME: 2. If files is of 0 length, return an error with error code invalid argument. - - // FIXME: 3. Let multiple equal the result of calling hasAttribute() with "multiple" on element. - - // FIXME: 4. if multiple is false and the length of files is not equal to 1, return an error with error code invalid argument. - - // FIXME: 5. Verify that each file given by the user exists. If any do not, return error with error code invalid argument. - - // FIXME: 6. Complete implementation specific steps equivalent to setting the selected files on the input element. If multiple is true files are be appended to element's selected files. - - // FIXME: 7. Fire these events in order on element: - - // FIXME: 1. input - - // FIXME: 2. change - - // FIXME: 8. Return success with data null. + // -> file is true + { + // FIXME: 1. Let files be the result of splitting text on the newline (\n) character. + // FIXME: 2. If files is of 0 length, return an error with error code invalid argument. + // FIXME: 3. Let multiple equal the result of calling hasAttribute() with "multiple" on element. + // FIXME: 4. if multiple is false and the length of files is not equal to 1, return an error with error code invalid argument. + // FIXME: 5. Verify that each file given by the user exists. If any do not, return error with error code invalid argument. + // FIXME: 6. Complete implementation specific steps equivalent to setting the selected files on the input element. If multiple is true files are be appended to element's selected files. + // FIXME: 7. Fire these events in order on element: + // FIXME: 1. input + // FIXME: 2. change + // FIXME: 8. Return success with data null. + } + // -> element is a non-typeable form control + { + // FIXME: 1. If element does not have an own property named value return an error with error code element not interactable + // FIXME: 2. If element is not mutable return an error with error code element not interactable. + // FIXME: 3. Set a property value to text on element. + // FIXME: 4. If element is suffering from bad input return an error with error code invalid argument. + // FIXME: 5. Return success with data null. + } + // -> elementis content editable + { + // If element does not currently have focus, set the text insertion caret after any child content. + } + // -> otherwise + { + // FIXME: 1. If element does not currently have focus, let current text length be the length of element's API value. + // FIXME: 2. Set the text insertion caret using set selection range using current text length for both the start and end parameters. + } } - - // -> element is a non-typeable form control - - { - // FIXME: 1. If element does not have an own property named value return an error with error code element not interactable - - // FIXME: 2. If element is not mutable return an error with error code element not interactable. - - // FIXME: 3. Set a property value to text on element. - - // FIXME: 4. If element is suffering from bad input return an error with error code invalid argument. - - // FIXME: 5. Return success with data null. - } - - // -> elementis content editable - - { - // If element does not currently have focus, set the text insertion caret after any child content. - } - - // -> otherwise - - { - // FIXME: 1. If element does not currently have focus, let current text length be the length of element's API value. - - // FIXME: 2. Set the text insertion caret using set selection range using current text length for both the start and end parameters. - } - // FIXME: 9. Let input state be the result of get the input state with session and session's current top-level browsing context. - // FIXME: 10. Let input id be a the result of generating a UUID. - // FIXME: 11. Let source be the result of create an input source with input state, and "key". - // FIXME: 12. Add an input source with input state, input id and source. - // FIXME: 13. Dispatch actions for a string with arguments input state, input id, and source, text, and session's current browsing context. - // FIXME: 14. Remove an input source with input state and input id. - // FIXME: 15. Return success with data null. return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "send keys not implemented"sv); @@ -2032,38 +1920,33 @@ Messages::WebDriverClient::DeleteAllCookiesResponse WebDriverConnection::delete_ } // 15.7 Perform Actions, https://w3c.github.io/webdriver/#perform-actions -Messages::WebDriverClient::PerformActionsResponse WebDriverConnection::perform_actions() +Messages::WebDriverClient::PerformActionsResponse WebDriverConnection::perform_actions(JsonValue const& payload) { + dbgln("FIXME: WebDriverConnection::perform_actions({})", payload); + // FIXME: 1. Let input state be the result of get the input state with session and session's current top-level browsing context. - - // FIXME: 2.Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. - - // FIXME: 3.Let actions by tick be the result of trying to extract an action sequence with input state, parameters, and actions options. - + // FIXME: 2. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. + // FIXME: 3. Let actions by tick be the result of trying to extract an action sequence with input state, parameters, and actions options. // FIXME: 4. If session's current browsing context is no longer open, return error with error code no such window. - // FIXME: 5. Try to handle any user prompts with session. - // FIXME: 6. Dispatch actions with input state, actions by tick, current browsing context, and actions options. If this results in an error return that error. - // FIXME: 7. Return success with data null. + return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "perform actions not implemented"sv); } // 15.8 Release Actions, https://w3c.github.io/webdriver/#release-actions Messages::WebDriverClient::ReleaseActionsResponse WebDriverConnection::release_actions() { + dbgln("FIXME: WebDriverConnection::release_actions()"); + // 1. If the current browsing context is no longer open, return error with error code no such window. TRY(ensure_current_browsing_context_is_open()); // FIXME: 2. Let input state be the result of get the input state with current session and current top-level browsing context. - // FIXME: 3. Let actions options be a new actions options with the is element origin steps set to represents a web element, and the get element origin steps set to get a WebElement origin. - // FIXME: 4. Let undo actions be input state’s input cancel list in reverse order. - // FIXME: 5. Try to dispatch tick actions with arguments undo actions, 0, current browsing context, and actions options. - // FIXME: 6. Reset the input state with current session and current top-level browsing context. // 7. Return success with data null. @@ -2229,9 +2112,9 @@ Messages::WebDriverClient::TakeElementScreenshotResponse WebDriverConnection::ta } // 18.1 Print Page, https://w3c.github.io/webdriver/#dfn-print-page -Messages::WebDriverClient::PrintPageResponse WebDriverConnection::print_page() +Messages::WebDriverClient::PrintPageResponse WebDriverConnection::print_page(JsonValue const& payload) { - // FIXME: Actually implement this :^) + dbgln("FIXME: WebDriverConnection::print_page({})", payload); return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "Print not implemented"sv); } diff --git a/Userland/Services/WebContent/WebDriverConnection.h b/Userland/Services/WebContent/WebDriverConnection.h index 079c240741..1ed76a14a5 100644 --- a/Userland/Services/WebContent/WebDriverConnection.h +++ b/Userland/Services/WebContent/WebDriverConnection.h @@ -84,7 +84,7 @@ private: virtual Messages::WebDriverClient::GetComputedLabelResponse get_computed_label(String const& element_id) override; virtual Messages::WebDriverClient::ElementClickResponse element_click(String const& element_id) override; virtual Messages::WebDriverClient::ElementClearResponse element_clear(String const& element_id) override; - virtual Messages::WebDriverClient::ElementSendKeysResponse element_send_keys(String const& element_id) override; + virtual Messages::WebDriverClient::ElementSendKeysResponse element_send_keys(String const& element_id, JsonValue const& payload) override; virtual Messages::WebDriverClient::GetSourceResponse get_source() override; virtual Messages::WebDriverClient::ExecuteScriptResponse execute_script(JsonValue const& payload) override; virtual Messages::WebDriverClient::ExecuteAsyncScriptResponse execute_async_script(JsonValue const& payload) override; @@ -93,7 +93,7 @@ private: virtual Messages::WebDriverClient::AddCookieResponse add_cookie(JsonValue const& payload) override; virtual Messages::WebDriverClient::DeleteCookieResponse delete_cookie(String const& name) override; virtual Messages::WebDriverClient::DeleteAllCookiesResponse delete_all_cookies() override; - virtual Messages::WebDriverClient::PerformActionsResponse perform_actions() override; + virtual Messages::WebDriverClient::PerformActionsResponse perform_actions(JsonValue const& payload) override; virtual Messages::WebDriverClient::ReleaseActionsResponse release_actions() override; virtual Messages::WebDriverClient::DismissAlertResponse dismiss_alert() override; virtual Messages::WebDriverClient::AcceptAlertResponse accept_alert() override; @@ -101,7 +101,7 @@ private: virtual Messages::WebDriverClient::SendAlertTextResponse send_alert_text(JsonValue const& payload) override; virtual Messages::WebDriverClient::TakeScreenshotResponse take_screenshot() override; virtual Messages::WebDriverClient::TakeElementScreenshotResponse take_element_screenshot(String const& element_id) override; - virtual Messages::WebDriverClient::PrintPageResponse print_page() override; + virtual Messages::WebDriverClient::PrintPageResponse print_page(JsonValue const& payload) override; virtual Messages::WebDriverClient::EnsureTopLevelBrowsingContextIsOpenResponse ensure_top_level_browsing_context_is_open() override; Web::HTML::BrowsingContext& current_browsing_context() { return *m_current_browsing_context; } diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp index 253aeacc8e..4d698e3bca 100644 --- a/Userland/Services/WebDriver/Client.cpp +++ b/Userland/Services/WebDriver/Client.cpp @@ -598,11 +598,11 @@ Web::WebDriver::Response Client::element_clear(Web::WebDriver::Parameters parame // 12.5.3 Element Send Keys, https://w3c.github.io/webdriver/#dfn-element-send-keys // POST /session/{session id}/element/{element id}/value -Web::WebDriver::Response Client::element_send_keys(Web::WebDriver::Parameters parameters, JsonValue) +Web::WebDriver::Response Client::element_send_keys(Web::WebDriver::Parameters parameters, JsonValue payload) { dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session//element//value"); auto session = TRY(find_session_with_id(parameters[0])); - return session->web_content_connection().element_send_keys(move(parameters[1])); + return session->web_content_connection().element_send_keys(move(parameters[1]), move(payload)); } // 13.1 Get Page Source, https://w3c.github.io/webdriver/#dfn-get-page-source @@ -679,11 +679,11 @@ Web::WebDriver::Response Client::delete_all_cookies(Web::WebDriver::Parameters p // 15.7 Perform Actions, https://w3c.github.io/webdriver/#perform-actions // POST /session/{session id}/actions -Web::WebDriver::Response Client::perform_actions(Web::WebDriver::Parameters parameters, JsonValue) +Web::WebDriver::Response Client::perform_actions(Web::WebDriver::Parameters parameters, JsonValue payload) { dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session//actions"); auto session = TRY(find_session_with_id(parameters[0])); - return session->web_content_connection().perform_actions(); + return session->web_content_connection().perform_actions(move(payload)); } // 15.8 Release Actions, https://w3c.github.io/webdriver/#release-actions @@ -751,11 +751,11 @@ Web::WebDriver::Response Client::take_element_screenshot(Web::WebDriver::Paramet // 18.1 Print Page, https://w3c.github.io/webdriver/#dfn-print-page // POST /session/{session id}/print -Web::WebDriver::Response Client::print_page(Web::WebDriver::Parameters parameters, JsonValue) +Web::WebDriver::Response Client::print_page(Web::WebDriver::Parameters parameters, JsonValue payload) { dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session//print"); auto session = TRY(find_session_with_id(parameters[0])); - return session->web_content_connection().print_page(); + return session->web_content_connection().print_page(move(payload)); } }