58 lines
1.8 KiB
Scheme
58 lines
1.8 KiB
Scheme
|
(import (chicken string))
|
||
|
(import r7rs
|
||
|
test
|
||
|
(chicken base)
|
||
|
(chicken string)
|
||
|
(chicken process)
|
||
|
(chicken gc)
|
||
|
srfi-34 ;;Exception Handling
|
||
|
srfi-35 ;;Exception Types
|
||
|
base64 ;;decoding screenshot data
|
||
|
http-client ;;API interaction
|
||
|
intarweb ;;Supporting HTTP functionality
|
||
|
uri-common ;;Supporting HTTP functionality
|
||
|
coops ;;Object system
|
||
|
alist-lib ;;Handling alists from JSON objects
|
||
|
medea ;;JSON handling
|
||
|
)
|
||
|
|
||
|
;; [[file:../webdriver.org::*Dependencies][Dependencies:5]]
|
||
|
(include-relative "../webdriver-impl.scm")
|
||
|
;; Dependencies:5 ends here
|
||
|
|
||
|
|
||
|
|
||
|
;; #+name: prep-geckodriver-test
|
||
|
|
||
|
;; [[file:../webdriver.org::prep-geckodriver-test][prep-geckodriver-test]]
|
||
|
|
||
|
;; prep-geckodriver-test ends here
|
||
|
|
||
|
|
||
|
|
||
|
;; #+name: wd-session-test
|
||
|
|
||
|
;; [[file:../webdriver.org::wd-session-test][wd-session-test]]
|
||
|
(test-group "session"
|
||
|
(let ((browser (new-WebDriver <Gecko>)))
|
||
|
(test "Initial state" #f (slot-value browser 'session-id))
|
||
|
(test-assert "Session id check" (string? (begin (initialize-session browser) (slot-value browser 'session-id))))
|
||
|
(test-assert "Session id after termination" (eq? #f (begin (terminate-session browser) (slot-value browser 'session-id))))
|
||
|
(terminate browser)))
|
||
|
;; wd-session-test ends here
|
||
|
|
||
|
|
||
|
|
||
|
;; #+name: wd-url-test
|
||
|
|
||
|
;; [[file:../webdriver.org::wd-url-test][wd-url-test]]
|
||
|
(test-group "url"
|
||
|
(let ((browser (new-WebDriver <Gecko>)))
|
||
|
(test "Initial state" #f (slot-value browser 'session-id))
|
||
|
(test "Navigating to the first website" "http://info.cern.ch/hypertext/WWW/TheProject.html"
|
||
|
(begin (initialize-session browser)
|
||
|
(set-url browser "http://info.cern.ch/hypertext/WWW/TheProject.html")
|
||
|
(url browser)))
|
||
|
(terminate browser)))
|
||
|
;; wd-url-test ends here
|