summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver/Client.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-16 07:15:57 -0500
committerLinus Groh <mail@linusgroh.de>2022-11-16 17:23:56 +0000
commit7cf2feb04739e79ef84b0585a1cdca26c111167f (patch)
tree208b30b018e357591511f49e28cf2287ed1e79ba /Userland/Services/WebDriver/Client.cpp
parent159dcb950718ad5784a3172ec9fbefdb8e5d60d6 (diff)
downloadserenity-7cf2feb04739e79ef84b0585a1cdca26c111167f.zip
LibWeb+WebContent+WebDriver: Implement Dismiss Alert
Diffstat (limited to 'Userland/Services/WebDriver/Client.cpp')
-rw-r--r--Userland/Services/WebDriver/Client.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Services/WebDriver/Client.cpp b/Userland/Services/WebDriver/Client.cpp
index bde5912f22..935e2a5523 100644
--- a/Userland/Services/WebDriver/Client.cpp
+++ b/Userland/Services/WebDriver/Client.cpp
@@ -539,6 +539,15 @@ Web::WebDriver::Response Client::delete_all_cookies(Web::WebDriver::Parameters p
return session->web_content_connection().delete_all_cookies();
}
+// 16.1 Dismiss Alert, https://w3c.github.io/webdriver/#dismiss-alert
+// POST /session/{session id}/alert/dismiss
+Web::WebDriver::Response Client::dismiss_alert(Web::WebDriver::Parameters parameters, JsonValue)
+{
+ dbgln_if(WEBDRIVER_DEBUG, "Handling POST /session/<session_id>/alert/dismiss");
+ auto* session = TRY(find_session_with_id(parameters[0]));
+ return session->web_content_connection().dismiss_alert();
+}
+
// 17.1 Take Screenshot, https://w3c.github.io/webdriver/#take-screenshot
// GET /session/{session id}/screenshot
Web::WebDriver::Response Client::take_screenshot(Web::WebDriver::Parameters parameters, JsonValue)