Documentation
¶
Overview ¶
Package webdriver is a small W3C WebDriver client (https://www.w3.org/TR/webdriver/): just what the e2e lane for Safari needs, to drive the real Safari through safaridriver (Playwright's WebKit is not Safari). It starts the driver, creates a session, navigates and deletes the session.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Base string // http://127.0.0.1:port
HTTP *http.Client
// PairedWait is how long NewSession keeps asking while Safari answers
// that it is "already paired with another WebDriver session": Safari
// releases the previous session some time after its DELETE, so a test
// that follows another one is refused for a moment. 0 asks once.
PairedWait time.Duration
}
Client talks to one WebDriver server.
func Start ¶
Start runs driver (for example /usr/bin/safaridriver) on a free port and waits for GET /status to answer. stop kills the driver by PID.
func (*Client) NewSession ¶
NewSession creates a session; caps is the alwaysMatch capabilities object. While Safari is still paired with a previous session it asks again, for at most PairedWait; any other refusal is returned at once.
type Error ¶
type Error struct {
Status int
Code string // "error" field, e.g. "session not created"
Message string
}
Error is a WebDriver error response (W3C section 6.6).
type Session ¶
type Session struct {
ID string
// Version is the browser's version the driver reported (capabilities
// browserVersion), "" if it did not say.
Version string
// contains filtered or unexported fields
}
Session is one browser session.