hara.runtime.chromedriver

browser

added in 4.0

(browser)(browser m)

starts the browser

browser:create

added in 4.0

(browser:create {:keys [id port], :as m, :or {id (h/sid), port (h/port:check-available 0)}})

creates a browser

current-tab

added in 4.0

(current-tab browser)

returns the active tab handle of the browser

evaluate

(evaluate browser expression & [{:keys [allow-unsafe-eval-blocked-by-csp await-promise context-id disable-breaks generate-preview include-command-line-api object-group repl-mode return-by-value silent throw-on-side-effect timeout unique-context-id user-gesture], :as m} timeout opts])

get-domain

(get-domain domain)

get-method

added in 4.0

(get-method domain method)

gets the method

goto

added in 4.0

(goto url & [timeout rt])

goto a given page

list-domains

added in 4.0

(list-domains)

lists all domains

list-methods

added in 4.0

(list-methods domain)

lists all spec methods

page-navigate

(page-navigate browser url & [{:keys [frame-id referrer referrer-policy transition-type], :as m} timeout opts])

screenshot

(screenshot browser & [{:keys [capture-beyond-viewport clip format from-surface quality], :as m} timeout opts])

send

(send browser method & [params timeout opts])

tab-close

added in 4.0

(tab-close browser tab)

closes the given tab

tab-create

added in 4.0

(tab-create browser url & [opts timeout extra-opts])

creates a new tab and returns a tab handle

tab-list

added in 4.0

(tab-list browser)

lists all open tabs

tab-switch

added in 4.0

(tab-switch browser tab & [{:keys [bootstrap], :or {bootstrap true}}])

switches the browser runtime to the given tab handle. bootstraps the tab by default so that !.js forms work there.

target-close

(target-close browser target-id & [{:keys [], :as m} timeout opts])

target-create

(target-create browser url & [{:keys [background browser-context-id enable-begin-frame-control height new-window width], :as m} timeout opts])

target-info

(target-info browser & [{:keys [target-id], :as m} timeout opts])

with-tab

macro

added in 4.0

(with-tab browser tab & body)

evaluates body with the browser switched to tab, then restores the previously active tab