Wd.ConnectionWebDriver connections.
A WebDriver connection abstracts over driver process spawns (if any) and the WebSocket-based communication protocol.
module Config : sig ... endDriver configuration.
type custom =
Config.t ->
(Webs.Url.t * (unit -> (unit, string) Stdlib.result), string) Stdlib.resultThe type for custom drivers.
Given a configuration which the driver should try to abide by, possibly erroring if it can't, the function must return an URL on which to perform the WebSocket handshake and a function to invoke on close to teardown the driver after the WebSocket has been closed.
The type for browser drivers.
open' driver opens a connection using driver driver. Connections are ressources, they must eventually be closed by close. config defaults to Config.make ().
val close : t -> (unit, string) Stdlib.resultclose c closes the connection. The function does not raise.
val handle : t -> (unit -> 'a) -> 'ahandle c f handles the command and event asynchrony of the protocol in function f, any use of a connection c must be wrapped by this function.
with_open driver f executes handle c (fun () -> f c) with c an open connection on driver. If f raises Webs_webdriver.Wd.Error it is turned into an Error value.
val url : t -> Webs.Url.turl c is the URL on which the WebSocket handshake was performed.