Daniel Ziltener
68c4194793
FossilOrigin-Name: bd39977c82cb9f2e943b2944ad4443e12748b7f854bb2de2c2d27ee99cd4fc01
75 lines
2.2 KiB
Scheme
75 lines
2.2 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-test>>
|
|
<<wd-exception>>
|
|
<<conditions>>
|
|
<<webdriver-class>>
|
|
<<webdriver-basics>>
|
|
<<webdriver-init>>
|
|
<<geckodriver-basic>>
|
|
<<geckodriver-capabilities>>
|
|
<<geckodriver-postprocess>>
|
|
<<wd-send>>
|
|
<<wd-init-session>>
|
|
<<wd-term-session>>
|
|
;; prep-geckodriver-test ends here
|
|
|
|
|
|
|
|
;; #+name: wd-session-test
|
|
|
|
;; [[file:../webdriver.org::wd-session-test][wd-session-test]]
|
|
<<prep-geckodriver-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]]
|
|
<<prep-geckodriver-test>>
|
|
<<wd-url>>
|
|
(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
|
|
|
|
;; [[file:../webdriver.org::*About This Egg][About This Egg:2]]
|
|
(test-exit)
|
|
;; About This Egg:2 ends here
|