forked from angel-popov/cl-selenium-webdriver
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuser-prompts.lisp
32 lines (21 loc) · 1.11 KB
/
user-prompts.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(in-package :webdriver-client)
(defun dismiss-alert (&key (session *session*))
"The Dismiss Alert command dismisses a simple dialog if present. A request to dismiss an alert user prompt, which may not necessarily have a dismiss button, has the same effect as accepting it.
Category: User prompts
See: https://www.w3.org/TR/webdriver1/#dismiss-alert"
(http-post-check (session-path session "/alert/dismiss")))
(defun accept-alert (&key (session *session*))
"Accept Alert.
Category: User prompts
See: https://www.w3.org/TR/webdriver1/#dfn-accept-alert"
(http-post-check (session-path session "/alert/accept")))
(defun alert-text (&key (session *session*))
"Get Alert Text.
Category: User prompts
See: https://www.w3.org/TR/webdriver1/#get-alert-text"
(http-get-value (session-path session "/alert/text")))
(defun (setf alert-text) (text &key (session *session*))
"The Send Alert Text command sets the text field of a window.prompt user prompt to the given value.
Category: User prompts
See: https://www.w3.org/TR/webdriver1/#send-alert-text"
(http-post-value (session-path session "/alert/text") :text text))