2023-11-09 00:21:49 +00:00
|
|
|
(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]]
|
2023-11-09 00:21:50 +00:00
|
|
|
<<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>>
|
2023-11-09 00:21:49 +00:00
|
|
|
;; prep-geckodriver-test ends here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; #+name: wd-session-test
|
|
|
|
|
|
|
|
;; [[file:../webdriver.org::wd-session-test][wd-session-test]]
|
2023-11-09 00:21:50 +00:00
|
|
|
<<prep-geckodriver-test>>
|
2023-11-09 00:21:49 +00:00
|
|
|
(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]]
|
2023-11-09 00:21:50 +00:00
|
|
|
<<prep-geckodriver-test>>
|
|
|
|
<<wd-url>>
|
2023-11-09 00:21:49 +00:00
|
|
|
(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
|
2023-11-09 00:21:50 +00:00
|
|
|
|
|
|
|
;; [[file:../webdriver.org::*About This Egg][About This Egg:2]]
|
|
|
|
(test-exit)
|
|
|
|
;; About This Egg:2 ends here
|