common

package
v0.0.0-...-87f9f75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DEBUG string = "DEBUG"
	INFO  string = "INFO"
	WARN  string = "WARN"
	ERROR string = "ERROR"
)
View Source
const (
	CSS_SELECTOR             string = "css selector"
	LINKTEXT_SELECTOR        string = "link text"
	PARTIALLINKTEXT_SELECTOR string = "partial link text"
	TAGNAME_SELECTOR         string = "tag name"
	XPATH_SELECTOR           string = "xpath"
)

https://w3c.github.io/webdriver/#dfn-table-of-location-strategies

Variables

This section is empty.

Functions

func SliceContains

func SliceContains(s []string, str string) bool

Types

type Action

type Action struct {
	Id         string `json:"id,omitempty"`
	Type       string `json:"type,omitempty"` // "key", "pointer", "wheel", or "none"
	Parameters struct {
		PointerType string `json:"pointerType,omitempty"` // "mouse", "pen", or "touch"
	} `json:"parameters,omitempty"`
	Actions []SubAction `json:"actions,omitempty"`
}

type Capability

type Capability struct {
	AcceptInsecureCerts       bool      `json:"acceptInsecureCerts,omitempty"`
	PageLoadStrategy          string    `json:"pageLoadStrategy,omitempty"`
	Proxy                     *Proxy    `json:"proxy,omitempty"`
	SetWindowRect             bool      `json:"setWindowRect,omitempty"`
	Timeouts                  *Timeouts `json:"timeouts,omitempty"`
	StrictFileInteractability bool      `json:"strictFileInteractability,omitempty"`
	UnhandledPromptBehavior   string    `json:"unhandledPromptBehavior,omitempty"`
}

https://w3c.github.io/webdriver/#dfn-table-of-standard-capabilities

type ChromeOptions

type ChromeOptions struct {
	Args             []string               `json:"args,omitempty"`
	Binary           string                 `json:"binary,omitempty"`
	Extensions       []string               `json:"extensions,omitempty"`
	LocalState       map[string]interface{} `json:"localState,omitempty"`
	Prefs            map[string]interface{} `json:"prefs,omitempty"`
	Detach           bool                   `json:"detach,omitempty"`
	DebuggerAddress  string                 `json:"debuggerAddress,omitempty"`
	ExcludeSwitches  []string               `json:"excludeSwitches,omitempty"`
	MinidumpPath     string                 `json:"minidumpPath,omitempty"`
	MobileEmulation  map[string]interface{} `json:"mobileEmulation,omitempty"`
	PerfLoggingPrefs map[string]interface{} `json:"perfLoggingPrefs,omitempty"`
	WindowTypes      []string               `json:"windowTypes,omitempty"`
}

type ChromeWebDriverSession

type ChromeWebDriverSession struct {
	Capabilities struct {
		AlwaysMatch struct {
			BrowserName         string        `json:"browserName,omitempty"`
			AcceptInsecureCerts bool          `json:"acceptInsecureCerts,omitempty"`
			ChromeOptions       ChromeOptions `json:"goog:chromeOptions,omitempty"`
		} `json:"alwaysMatch,omitempty"`
	} `json:"capabilities,omitempty"`
}
type Cookie struct {
	Name           string `json:"Name"`
	Value          string `json:"Value,omitempty"`
	Path           string `json:"Path,omitempty"`
	Domain         string `json:"Domain,omitempty"`
	SecureOnlyFlag string `json:"SecureOnlyFlag,omitempty"`
	HttpOnlyFlag   string `json:"HttpOnlyFlag,omitempty"`
	ExpireTimeFlag string `json:"ExpireTimeFlag,omitempty"`
}

https://w3c.github.io/webdriver/#dfn-table-for-cookie-conversion

type DriverStatus

type DriverStatus struct {
	Value struct {
		Build struct {
			Version string `json:"version"`
		} `json:"build"`
		Message string `json:"message"`
		Os      struct {
			Arch    string `json:"arch"`
			Name    string `json:"name"`
			Version string `json:"version"`
		} `json:"os"`
		Ready bool `json:"ready"`
	} `json:"value"`
}

https://w3c.github.io/webdriver/#dfn-status

type EdgeOptions

type EdgeOptions struct {
	Args             []string               `json:"args,omitempty"`
	Binary           string                 `json:"binary,omitempty"`
	Extensions       []string               `json:"extensions,omitempty"`
	LocalState       map[string]interface{} `json:"localState,omitempty"`
	Prefs            map[string]interface{} `json:"prefs,omitempty"`
	Detach           bool                   `json:"detach,omitempty"`
	DebuggerAddress  string                 `json:"debuggerAddress,omitempty"`
	ExcludeSwitches  []string               `json:"excludeSwitches,omitempty"`
	MinidumpPath     string                 `json:"minidumpPath,omitempty"`
	MobileEmulation  map[string]interface{} `json:"mobileEmulation,omitempty"`
	PerfLoggingPrefs map[string]interface{} `json:"perfLoggingPrefs,omitempty"`
	WindowTypes      []string               `json:"windowTypes,omitempty"`
	WdpAddress       string                 `json:"wdpAddress,omitempty"`
	WdpPassword      string                 `json:"wdpPassword,omitempty"`
	WdpUsername      string                 `json:"wdpUsername,omitempty"`
	WebviewOptions   map[string]interface{} `json:"webviewOptions,omitempty"`
	WindowsApp       string                 `json:"windowsApp,omitempty"`
}

type EdgeWebDriverSession

type EdgeWebDriverSession struct {
	Capabilities struct {
		AlwaysMatch struct {
			BrowserName         string      `json:"browserName,omitempty"`
			AcceptInsecureCerts bool        `json:"acceptInsecureCerts,omitempty"`
			EdgeOptions         EdgeOptions `json:"ms:edgeOptions,omitempty"`
		} `json:"alwaysMatch,omitempty"`
	} `json:"capabilities,omitempty"`
}

type Element

type Element struct {
	Id      string
	Text    string
	TagName string
}

type FirefoxOptions

type FirefoxOptions struct {
	Binary  string                 `json:"binary,omitempty"`
	Profile string                 `json:"profile,omitempty"`
	Args    []string               `json:"args,omitempty"`
	Prefs   map[string]interface{} `json:"prefs,omitempty"`
	Log     struct {
		Level string `json:"level,omitempty"`
	} `json:"log,omitempty"`
	Env struct {
		Log  string `json:"MOZ_LOG,omitempty"`
		File string `json:"MOZ_LOG_FILE,omitempty"`
	} `json:"env,omitempty"`
	AndroidPackage         string   `json:"androidPackage,omitempty"`
	AndroidActivity        string   `json:"androidActivity,omitempty"`
	AndroidDeviceSerial    string   `json:"androidDeviceSerial,omitempty"`
	AndroidIntentArguments []string `json:"androidIntentArguments,omitempty"`
}

type GeckoWebDriverSession

type GeckoWebDriverSession struct {
	Capabilities struct {
		AlwaysMatch struct {
			BrowserName         string         `json:"browserName,omitempty"`
			AcceptInsecureCerts bool           `json:"acceptInsecureCerts,omitempty"`
			FirefoxOptions      FirefoxOptions `json:"moz:firefoxOptions,omitempty"`
		} `json:"alwaysMatch,omitempty"`
	} `json:"capabilities,omitempty"`
}

type Proxy

type Proxy struct {
	ProxyType          string   `json:"proxyType,omitempty"`
	ProxyAutoconfigUrl string   `json:"proxyAutoconfigUrl,omitempty"`
	FtpProxy           string   `json:"ftpProxy,omitempty"`
	HttpProxy          string   `json:"httpProxy,omitempty"`
	NoProxy            []string `json:"noProxy,omitempty"`
	SslProxy           string   `json:"sslProxy,omitempty"`
	SocksProxy         string   `json:"socksProxy,omitempty"`
	SocksVersion       int      `json:"socksVersion,omitempty"`
}

https://w3c.github.io/webdriver/#dfn-table-of-standard-capabilities

type Rect

type Rect struct {
	X      int `json:"x"`
	Y      int `json:"y"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

type SubAction

type SubAction struct {
	Type     string `json:"type,omitempty"` // pause, pointerDown, pointerUp, pointerMove, pointerCancel
	Duration int    `json:"duration,omitempty"`
	X        int    `json:"x,omitempty"`
	Y        int    `json:"y,omitempty"`
	Origin   string `json:"origin,omitempty"`
	Button   int    `json:"button"`
}

type Timeouts

type Timeouts struct {
	Implicit int `json:"implicit"`
	PageLoad int `json:"pageLoad"`
	Script   int `json:"script"`
}

https://w3c.github.io/webdriver/#dfn-timeouts-object

type WebDriverOptions

type WebDriverOptions struct {
	Debug           bool
	Command         string
	CommandLineArgs []string
	CommandPort     string
	Args            []string
	Prefs           map[string]interface{}
	WebDriverBinary string
	Binary          string
	Url             string
	BrowserName     string
}

type WebDriverVersion

type WebDriverVersion struct {
	DriverVersion string
	Osname        string
	Osarch        string
	Osversion     string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL