Daniel Ziltener
244029a0c8
FossilOrigin-Name: 370c4e8ed3567a4e0f0933ac3ba749973ba041efa3b7d61310a6e5d296e68e21
57 lines
1.8 KiB
Scheme
57 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
|