mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
WebDriver+Browser: Implement GET /session/{id}/element/{id}/screenshot
This commit is contained in:
parent
3c1c2994f1
commit
b0eb45f7c7
9 changed files with 79 additions and 0 deletions
|
@ -218,6 +218,16 @@ Messages::WebDriverSessionClient::QuerySelectorAllResponse WebDriverConnection::
|
|||
return { {} };
|
||||
}
|
||||
|
||||
void WebDriverConnection::scroll_element_into_view(i32 element_id)
|
||||
{
|
||||
dbgln("WebDriverConnection: scroll_element_into_view {}", element_id);
|
||||
if (auto browser_window = m_browser_window.strong_ref()) {
|
||||
auto& tab = browser_window->active_tab();
|
||||
if (tab.webdriver_endpoints().on_scroll_element_into_view)
|
||||
tab.webdriver_endpoints().on_scroll_element_into_view(element_id);
|
||||
}
|
||||
}
|
||||
|
||||
Messages::WebDriverSessionClient::IsElementSelectedResponse WebDriverConnection::is_element_selected(i32 element_id)
|
||||
{
|
||||
dbgln("WebDriverConnection: is_element_selected {}", element_id);
|
||||
|
@ -329,4 +339,16 @@ Messages::WebDriverSessionClient::TakeScreenshotResponse WebDriverConnection::ta
|
|||
return { {} };
|
||||
}
|
||||
|
||||
Messages::WebDriverSessionClient::TakeElementScreenshotResponse WebDriverConnection::take_element_screenshot(i32 element_id)
|
||||
{
|
||||
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: take_element_screenshot {}", element_id);
|
||||
if (auto browser_window = m_browser_window.strong_ref()) {
|
||||
auto& tab = browser_window->active_tab();
|
||||
if (tab.webdriver_endpoints().on_take_element_screenshot)
|
||||
return { tab.webdriver_endpoints().on_take_element_screenshot(element_id) };
|
||||
}
|
||||
|
||||
return { {} };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue