Documentation ¶
Index ¶
- Constants
- func ChromeWebDriver(port int, options []selenium.ServiceOption) (*selenium.Service, selenium.WebDriver, error)
- func ExtractScriptRawValue(bytes []byte, key string) (value interface{}, err error)
- func FindShadowElement(d selenium.WebDriver, e selenium.WebElement, selectors ...string) (selenium.WebElement, error)
- func FindShadowElements(d selenium.WebDriver, e selenium.WebElement, selectors ...string) ([]selenium.WebElement, error)
- func FindShadowText(d selenium.WebDriver, e selenium.WebElement, selectors ...string) (string, error)
- func FirefoxWebDriver(port int, options []selenium.ServiceOption) (*selenium.Service, selenium.WebDriver, error)
- func GetWebDriver() (*selenium.Service, selenium.WebDriver, error)
- type AppServer
Constants ¶
const ( // LongTimeout is the timeout for waiting the full page to load, with // data coming from Datastore. You may not need this if you only need // to wait for the initial Polymer rendering. LongTimeout = time.Second * 30 )
const StaticTestDataRevision = "24278ab61781de72ed363b866ae6b50b86822b27"
StaticTestDataRevision is the SHA for the local (static) test run summaries.
Variables ¶
This section is empty.
Functions ¶
func ChromeWebDriver ¶
func ChromeWebDriver(port int, options []selenium.ServiceOption) (*selenium.Service, selenium.WebDriver, error)
ChromeWebDriver starts up ChromeDriver on the given port.
func ExtractScriptRawValue ¶
ExtractScriptRawValue extracts the value of a given key from the return value of webdriver.ExecuteScriptRaw (raw bytes).
func FindShadowElement ¶
func FindShadowElement( d selenium.WebDriver, e selenium.WebElement, selectors ...string) (selenium.WebElement, error)
FindShadowElement returns the first element found by an equivalent call to FindShadowElements.
func FindShadowElements ¶
func FindShadowElements( d selenium.WebDriver, e selenium.WebElement, selectors ...string) ([]selenium.WebElement, error)
FindShadowElements finds the shadow DOM children via the given query selectors, recursively. The function takes a variable number of selectors; the selectors are combined together similar to CSS descendant combinators. However, all but the the last selector are expected to match to hosts of shadow DOM, and the shadow DOM boundaries will be crossed.
e.g. FindShadowElements(wd, node, "bar", "baz blah"). All matches of "bar" must have shadow roots, and the function finds all "baz blah" within each shadow DOM.
func FindShadowText ¶
func FindShadowText( d selenium.WebDriver, e selenium.WebElement, selectors ...string) (string, error)
FindShadowText returns the Text of the element returned by an equivalent call to FindShadowElement.
func FirefoxWebDriver ¶
func FirefoxWebDriver(port int, options []selenium.ServiceOption) (*selenium.Service, selenium.WebDriver, error)
FirefoxWebDriver starts up GeckoDriver on the given port.
func GetWebDriver ¶
GetWebDriver starts a WebDriver service (server) and creates a remote (client). Note: Make sure to close the remote first and the service later, e.g.
server, driver, err := GetWebDriver()
if err != nil { panic(err) }
defer server.Stop() defer driver.Quit()
Types ¶
type AppServer ¶
type AppServer interface { // Hook for closing the process that runs the webserver. io.Closer // GetWebappURL returns the URL for the given path on the running webapp. GetWebappURL(path string) string }
AppServer is an abstraction for navigating an instance of the webapp.
func NewWebserver ¶
NewWebserver creates an AppServer instance, which may be backed by local or remote (staging) servers.