mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +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
|
@ -607,6 +607,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
return active_tab().view().query_selector_all(start_node_id, selector);
|
||||
};
|
||||
|
||||
new_tab.webdriver_endpoints().on_scroll_element_into_view = [this](i32 element_id) {
|
||||
active_tab().view().scroll_element_into_view(element_id);
|
||||
};
|
||||
|
||||
new_tab.webdriver_endpoints().on_is_element_selected = [this](i32 element_id) {
|
||||
return active_tab().view().is_element_selected(element_id);
|
||||
};
|
||||
|
@ -651,6 +655,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
|
|||
return active_tab().view().webdriver_execute_script(body, json_arguments, timeout, async);
|
||||
};
|
||||
|
||||
new_tab.webdriver_endpoints().on_take_element_screenshot = [this](i32 element_id) {
|
||||
return active_tab().view().take_element_screenshot(element_id);
|
||||
};
|
||||
|
||||
new_tab.load(url);
|
||||
|
||||
dbgln_if(SPAM_DEBUG, "Added new tab {:p}, loading {}", &new_tab, url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue