1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:17:34 +00:00

WebDriver: Implement GET /session/{id}/element/{id}/name endpoint

This commit is contained in:
Tobias Christiansen 2022-10-20 22:40:32 +02:00 committed by Linus Groh
parent be6bbdaa3b
commit a534e61b44
7 changed files with 50 additions and 0 deletions

View file

@ -188,4 +188,15 @@ Messages::WebDriverSessionClient::GetComputedValueForElementResponse WebDriverCo
return { "" };
}
Messages::WebDriverSessionClient::GetElementTagNameResponse WebDriverConnection::get_element_tag_name(i32 element_id)
{
dbgln("WebDriverConnection: get_computed_value_for_element");
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.webdriver_endpoints().on_get_element_tag_name)
return { tab.webdriver_endpoints().on_get_element_tag_name(element_id) };
}
return { "" };
}
}

View file

@ -53,6 +53,7 @@ public:
virtual Messages::WebDriverSessionClient::GetElementPropertyResponse get_element_property(i32 element_id, String const& name) override;
virtual Messages::WebDriverSessionClient::GetActiveDocumentsTypeResponse get_active_documents_type() override;
virtual Messages::WebDriverSessionClient::GetComputedValueForElementResponse get_computed_value_for_element(i32 element_id, String const& property_name) override;
virtual Messages::WebDriverSessionClient::GetElementTagNameResponse get_element_tag_name(i32 element_id) override;
private:
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<BrowserWindow> browser_window);

View file

@ -22,5 +22,6 @@ endpoint WebDriverSessionClient {
get_element_property(i32 element_id, String name) => (Optional<String> property)
get_active_documents_type() => (String type)
get_computed_value_for_element(i32 element_id, String property_name) => (String computed_value)
get_element_tag_name(i32 element_id) => (String tag_name)
}