1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +00:00

WebDriver: Implement stub for /session/{id}/print

This commit is contained in:
Baitinq 2022-11-27 00:30:03 +01:00 committed by Linus Groh
parent a1c1ab5f8d
commit 02a2018ec4
7 changed files with 23 additions and 0 deletions

View file

@ -53,4 +53,5 @@ 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)
}

View file

@ -1533,6 +1533,13 @@ Messages::WebDriverClient::TakeElementScreenshotResponse WebDriverConnection::ta
return encoded_string;
}
// 18.1 Print Page, https://w3c.github.io/webdriver/#dfn-print-page
Messages::WebDriverClient::PrintPageResponse WebDriverConnection::print_page()
{
// FIXME: Actually implement this :^)
return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::UnsupportedOperation, "Print not implemented"sv);
}
// https://w3c.github.io/webdriver/#dfn-no-longer-open
ErrorOr<void, Web::WebDriver::Error> WebDriverConnection::ensure_open_top_level_browsing_context()
{

View file

@ -88,6 +88,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;
ErrorOr<void, Web::WebDriver::Error> ensure_open_top_level_browsing_context();
ErrorOr<void, Web::WebDriver::Error> handle_any_user_prompts();