Documentation ¶
Index ¶
- Constants
- Variables
- func DeviceList() (devices []gadb.Device, err error)
- func IOSDevices(udid ...string) (devices []gidevice.Device, err error)
- func NewUIADriver(capabilities Capabilities, urlPrefix string) (driver *uiaDriver, err error)
- type Action
- type ActionOption
- func WithCustomDirection(sx, sy, ex, ey float64) ActionOption
- func WithDescription(description string) ActionOption
- func WithDirection(direction string) ActionOption
- func WithID(id string) ActionOption
- func WithIdentifier(identifier string) ActionOption
- func WithIgnoreNotFoundError(ignoreError bool) ActionOption
- func WithIndex(index int) ActionOption
- func WithMaxRetryTimes(maxRetryTimes int) ActionOption
- func WithOffset(offsetX, offsetY int) ActionOption
- func WithScope(x1, y1, x2, y2 float64) ActionOption
- func WithText(text string) ActionOption
- func WithTimeout(timeout int) ActionOption
- func WithWaitTime(sec float64) ActionOption
- type AlertAction
- type AndroidDevice
- func (dev *AndroidDevice) NewDriver(capabilities Capabilities) (driverExt *DriverExt, err error)
- func (dev *AndroidDevice) NewHTTPDriver(capabilities Capabilities) (driver *uiaDriver, err error)
- func (dev *AndroidDevice) NewUSBDriver(capabilities Capabilities) (driver *uiaDriver, err error)
- func (dev *AndroidDevice) UUID() string
- type AndroidDeviceOption
- type AppBaseInfo
- type AppInfo
- type AppLaunchOption
- func (opt AppLaunchOption) WithArguments(args []string) AppLaunchOption
- func (opt AppLaunchOption) WithBundleId(bundleId string) AppLaunchOption
- func (opt AppLaunchOption) WithBySelector(bySelector ...BySelector) AppLaunchOption
- func (opt AppLaunchOption) WithEnvironment(env map[string]string) AppLaunchOption
- func (opt AppLaunchOption) WithShouldWaitForQuiescence(b bool) AppLaunchOption
- type AppState
- type BatteryInfo
- type BatteryState
- type BatteryStatus
- type BySelector
- type CVArgs
- type CVOption
- type Capabilities
- func (caps Capabilities) WithAppLaunchOption(launchOpt AppLaunchOption) Capabilities
- func (caps Capabilities) WithDefaultAlertAction(alertAction AlertAction) Capabilities
- func (caps Capabilities) WithDisableAutomaticScreenshots(b bool) Capabilities
- func (caps Capabilities) WithElementResponseAttributes(s string) Capabilities
- func (caps Capabilities) WithEventloopIdleDelaySec(second float64) Capabilities
- func (caps Capabilities) WithMaxTypingFrequency(n int) Capabilities
- func (caps Capabilities) WithShouldTerminateApp(b bool) Capabilities
- func (caps Capabilities) WithShouldUseCompactResponses(b bool) Capabilities
- func (caps Capabilities) WithShouldUseSingletonTestManager(b bool) Capabilities
- func (caps Capabilities) WithShouldUseTestManagerForVisibilityDetection(b bool) Capabilities
- func (caps Capabilities) WithWaitForIdleTimeout(second float64) Capabilities
- type Condition
- type DataOption
- func WithCustomOption(key string, value interface{}) DataOption
- func WithDataFrequency(frequency int) DataOption
- func WithDataIdentifier(identifier string) DataOption
- func WithDataIgnoreNotFoundError(ignoreError bool) DataOption
- func WithDataIndex(index int) DataOption
- func WithDataMaxRetryTimes(maxRetryTimes int) DataOption
- func WithDataOffset(offsetX, offsetY int) DataOption
- func WithDataPressDuration(duration float64) DataOption
- func WithDataScope(x1, x2, y1, y2 int) DataOption
- func WithDataSteps(steps int) DataOption
- func WithDataWaitTime(sec float64) DataOption
- type DataOptions
- type Device
- type DeviceButton
- type DeviceInfo
- type DeviceLogcat
- type DeviceStatus
- type Direction
- type Driver
- type DriverExt
- func (dExt *DriverExt) CloseMjpegStream()
- func (dExt *DriverExt) ConnectMjpegStream(httpClient *http.Client) (err error)
- func (dExt *DriverExt) DoAction(action MobileAction) error
- func (dExt *DriverExt) DoValidation(check, assert, expected string, message ...string) bool
- func (dExt *DriverExt) DoubleTap(param string) (err error)
- func (dExt *DriverExt) DoubleTapOffset(param string, xOffset, yOffset float64) (err error)
- func (dExt *DriverExt) DoubleTapXY(x, y float64) error
- func (dExt *DriverExt) Drag(pathname string, toX, toY int, pressForDuration ...float64) (err error)
- func (dExt *DriverExt) DragFloat(pathname string, toX, toY float64, pressForDuration ...float64) (err error)
- func (dExt *DriverExt) DragOffset(pathname string, toX, toY int, xOffset, yOffset float64, ...) (err error)
- func (dExt *DriverExt) DragOffsetFloat(pathname string, toX, toY, xOffset, yOffset float64, ...) (err error)
- func (dExt *DriverExt) FindAllImageRect(search string) (rects []image.Rectangle, err error)
- func (dExt *DriverExt) FindImageRectInUIKit(imagePath string, options ...DataOption) (x, y, width, height float64, err error)
- func (dExt *DriverExt) FindTextByOCR(ocrText string, options ...DataOption) (x, y, width, height float64, err error)
- func (dExt *DriverExt) FindTextsByOCR(ocrTexts []string, options ...DataOption) (points [][]float64, err error)
- func (dExt *DriverExt) FindUIElement(param string) (ele WebElement, err error)
- func (dExt *DriverExt) FindUIRectInUIKit(search string, options ...DataOption) (x, y, width, height float64, err error)
- func (dExt *DriverExt) ForceTouch(pathname string, pressure float64, duration ...float64) (err error)
- func (dExt *DriverExt) ForceTouchOffset(pathname string, pressure, xOffset, yOffset float64, duration ...float64) (err error)
- func (dExt *DriverExt) GetImageXY(imagePath string, options ...DataOption) (point PointF, err error)
- func (dExt *DriverExt) GetPerfData() []string
- func (dExt *DriverExt) GetTextXY(ocrText string, options ...DataOption) (point PointF, err error)
- func (dExt *DriverExt) GetTextXYs(ocrText []string, options ...DataOption) (points []PointF, err error)
- func (dExt *DriverExt) IsImageExist(text string) bool
- func (dExt *DriverExt) IsLabelExist(label string) bool
- func (dExt *DriverExt) IsNameExist(name string) bool
- func (dExt *DriverExt) IsOCRExist(text string) bool
- func (dExt *DriverExt) LoopUntil(findAction, findCondition, foundAction Action, options ...DataOption) error
- func (dExt *DriverExt) MappingToRectInUIKit(rect image.Rectangle) (x, y, width, height float64)
- func (dExt *DriverExt) PerformActions(actions *W3CActions) error
- func (dExt *DriverExt) PerformTouchActions(touchActions *TouchActions) error
- func (dExt *DriverExt) ScreenShot(fileName string) (string, error)
- func (dExt *DriverExt) SwipeDown(options ...DataOption) (err error)
- func (dExt *DriverExt) SwipeLeft(options ...DataOption) (err error)
- func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ...DataOption) error
- func (dExt *DriverExt) SwipeRight(options ...DataOption) (err error)
- func (dExt *DriverExt) SwipeTo(direction string, options ...DataOption) (err error)
- func (dExt *DriverExt) SwipeUntil(direction interface{}, findCondition Action, foundAction Action, ...) error
- func (dExt *DriverExt) SwipeUp(options ...DataOption) (err error)
- func (dExt *DriverExt) Tap(param string, options ...DataOption) error
- func (dExt *DriverExt) TapAbsXY(x, y float64, options ...DataOption) error
- func (dExt *DriverExt) TapByCV(imagePath string, options ...DataOption) error
- func (dExt *DriverExt) TapByOCR(ocrText string, options ...DataOption) error
- func (dExt *DriverExt) TapOffset(param string, xOffset, yOffset float64, options ...DataOption) (err error)
- func (dExt *DriverExt) TapWithNumber(param string, numberOfTaps int) (err error)
- func (dExt *DriverExt) TapWithNumberOffset(param string, numberOfTaps int, xOffset, yOffset float64) (err error)
- func (dExt *DriverExt) TapXY(x, y float64, options ...DataOption) error
- func (dExt *DriverExt) TouchAndHold(pathname string, duration ...float64) (err error)
- func (dExt *DriverExt) TouchAndHoldOffset(pathname string, xOffset, yOffset float64, duration ...float64) (err error)
- type ElementAttribute
- func (ea ElementAttribute) String() string
- func (ea ElementAttribute) WithAccessibilityContainer(b bool) ElementAttribute
- func (ea ElementAttribute) WithAccessible(b bool) ElementAttribute
- func (ea ElementAttribute) WithEnabled(b bool) ElementAttribute
- func (ea ElementAttribute) WithLabel(s string) ElementAttribute
- func (ea ElementAttribute) WithName(s string) ElementAttribute
- func (ea ElementAttribute) WithSelected(b bool) ElementAttribute
- func (ea ElementAttribute) WithType(elemType ElementType) ElementAttribute
- func (ea ElementAttribute) WithUID(uid string) ElementAttribute
- func (ea ElementAttribute) WithValue(s string) ElementAttribute
- func (ea ElementAttribute) WithVisible(b bool) ElementAttribute
- type ElementType
- type EventPageID
- type EventUsageID
- type ExportPoint
- type FingerAction
- type FingerMove
- type IOSDevice
- func (dev *IOSDevice) NewDriver(capabilities Capabilities) (driverExt *DriverExt, err error)
- func (dev *IOSDevice) NewHTTPDriver(capabilities Capabilities) (driver WebDriver, err error)
- func (dev *IOSDevice) NewUSBDriver(capabilities Capabilities) (driver WebDriver, err error)
- func (dev *IOSDevice) UUID() string
- type IOSDeviceOption
- func GetIOSDeviceOptions(dev *IOSDevice) (deviceOptions []IOSDeviceOption)
- func WithAcceptAlertButtonSelector(selector string) IOSDeviceOption
- func WithDismissAlertButtonSelector(selector string) IOSDeviceOption
- func WithLogOn(logOn bool) IOSDeviceOption
- func WithPerfOptions(options ...gidevice.PerfOption) IOSDeviceOption
- func WithResetHomeOnStartup(reset bool) IOSDeviceOption
- func WithSnapshotMaxDepth(depth int) IOSDeviceOption
- func WithUDID(udid string) IOSDeviceOption
- func WithWDAMjpegPort(port int) IOSDeviceOption
- func WithWDAPort(port int) IOSDeviceOption
- type KeyCode
- type KeyFlag
- type KeyMeta
- type Location
- type MobileAction
- type MobileMethod
- type NotificationType
- type OCRResult
- type OCRService
- type Orientation
- type PasteboardType
- type PickerWheelOrder
- type Point
- type PointF
- type ProtectedResource
- type Rect
- type ResponseOCR
- type Rotation
- type Screen
- type SessionInfo
- type Size
- type SourceOption
- func (opt SourceOption) WithExcludedAttributes(attributes []string) SourceOption
- func (opt SourceOption) WithFormatAsDescription() SourceOption
- func (opt SourceOption) WithFormatAsJson() SourceOption
- func (opt SourceOption) WithFormatAsXml() SourceOption
- func (opt SourceOption) WithScope(scope string) SourceOption
- type TemplateMatchMode
- type TouchAction
- func (ta *TouchAction) Add(x, y int, startTime ...float64) *TouchAction
- func (ta *TouchAction) AddFloat(x, y float64, startTime ...float64) *TouchAction
- func (ta *TouchAction) AddPoint(point Point, startTime ...float64) *TouchAction
- func (ta *TouchAction) AddPointF(point PointF, startTime ...float64) *TouchAction
- type TouchActionLongPress
- type TouchActionMoveTo
- type TouchActionPress
- type TouchActionTap
- type TouchActions
- func (act *TouchActions) Cancel() *TouchActions
- func (act *TouchActions) LongPress(opt TouchActionLongPress) *TouchActions
- func (act *TouchActions) MoveTo(opt TouchActionMoveTo) *TouchActions
- func (act *TouchActions) Press(opt TouchActionPress) *TouchActions
- func (act *TouchActions) Release() *TouchActions
- func (act *TouchActions) Tap(opt TouchActionTap) *TouchActions
- func (act *TouchActions) Wait(second ...float64) *TouchActions
- type UiSelectorHelper
- func (s UiSelectorHelper) Checkable(b bool) UiSelectorHelper
- func (s UiSelectorHelper) Checked(b bool) UiSelectorHelper
- func (s UiSelectorHelper) ChildSelector(selector UiSelectorHelper) UiSelectorHelper
- func (s UiSelectorHelper) ClassName(className string) UiSelectorHelper
- func (s UiSelectorHelper) ClassNameMatches(regex string) UiSelectorHelper
- func (s UiSelectorHelper) Clickable(b bool) UiSelectorHelper
- func (s UiSelectorHelper) ContainerSelector(selector UiSelectorHelper) UiSelectorHelper
- func (s UiSelectorHelper) Description(desc string) UiSelectorHelper
- func (s UiSelectorHelper) DescriptionContains(desc string) UiSelectorHelper
- func (s UiSelectorHelper) DescriptionMatches(regex string) UiSelectorHelper
- func (s UiSelectorHelper) DescriptionStartsWith(desc string) UiSelectorHelper
- func (s UiSelectorHelper) Enabled(b bool) UiSelectorHelper
- func (s UiSelectorHelper) Focusable(b bool) UiSelectorHelper
- func (s UiSelectorHelper) Focused(b bool) UiSelectorHelper
- func (s UiSelectorHelper) FromParent(selector UiSelectorHelper) UiSelectorHelper
- func (s UiSelectorHelper) Index(index int) UiSelectorHelper
- func (s UiSelectorHelper) Instance(instance int) UiSelectorHelper
- func (s UiSelectorHelper) LongClickable(b bool) UiSelectorHelper
- func (s UiSelectorHelper) PackageNameMatches(regex string) UiSelectorHelper
- func (s UiSelectorHelper) PatternSelector(selector UiSelectorHelper) UiSelectorHelper
- func (s UiSelectorHelper) ResourceId(id string) UiSelectorHelper
- func (s UiSelectorHelper) ResourceIdMatches(regex string) UiSelectorHelper
- func (s UiSelectorHelper) Scrollable(b bool) UiSelectorHelper
- func (s UiSelectorHelper) Selected(b bool) UiSelectorHelper
- func (s UiSelectorHelper) String() string
- func (s UiSelectorHelper) Text(text string) UiSelectorHelper
- func (s UiSelectorHelper) TextContains(text string) UiSelectorHelper
- func (s UiSelectorHelper) TextMatches(regex string) UiSelectorHelper
- func (s UiSelectorHelper) TextStartsWith(text string) UiSelectorHelper
- type W3CActions
- func (act *W3CActions) DoubleTap(x, y int, element ...WebElement) *W3CActions
- func (act *W3CActions) FingerAction(fingerAct *FingerAction, fActs ...*FingerAction) *W3CActions
- func (act *W3CActions) Press(x, y int, second float64, element ...WebElement) *W3CActions
- func (act *W3CActions) SendKeys(text string) *W3CActions
- func (act *W3CActions) Swipe(fromX, fromY, toX, toY int, element ...WebElement) *W3CActions
- func (act *W3CActions) SwipeFloat(fromX, fromY, toX, toY float64, element ...WebElement) *W3CActions
- func (act *W3CActions) Tap(x, y int, element ...WebElement) *W3CActions
- type W3CGestures
- type WebDriver
- type WebElement
Constants ¶
const ( AppInstall MobileMethod = "install" AppUninstall MobileMethod = "uninstall" AppStart MobileMethod = "app_start" AppLaunch MobileMethod = "app_launch" // 等待 app 打开并堵塞到 app 首屏加载完成,可以传入 app 的启动参数、环境变量 AppLaunchUnattached MobileMethod = "app_launch_unattached" // 只负责通知打开 app,不堵塞等待,不可传入启动参数 AppTerminate MobileMethod = "app_terminate" AppStop MobileMethod = "app_stop" CtlScreenShot MobileMethod = "screenshot" CtlSleep MobileMethod = "sleep" CtlStartCamera MobileMethod = "camera_start" // alias for app_launch camera CtlStopCamera MobileMethod = "camera_stop" // alias for app_terminate camera RecordStart MobileMethod = "record_start" RecordStop MobileMethod = "record_stop" // UI validation SelectorName string = "ui_name" SelectorLabel string = "ui_label" SelectorOCR string = "ui_ocr" SelectorImage string = "ui_image" AssertionExists string = "exists" AssertionNotExists string = "not_exists" // UI handling ACTION_Home MobileMethod = "home" ACTION_TapXY MobileMethod = "tap_xy" ACTION_TapAbsXY MobileMethod = "tap_abs_xy" ACTION_TapByOCR MobileMethod = "tap_ocr" ACTION_TapByCV MobileMethod = "tap_cv" ACTION_Tap MobileMethod = "tap" ACTION_DoubleTapXY MobileMethod = "double_tap_xy" ACTION_DoubleTap MobileMethod = "double_tap" ACTION_Swipe MobileMethod = "swipe" ACTION_Input MobileMethod = "input" // custom actions ACTION_SwipeToTapApp MobileMethod = "swipe_to_tap_app" // swipe left & right to find app and tap ACTION_SwipeToTapText MobileMethod = "swipe_to_tap_text" // swipe up & down to find text and tap ACTION_SwipeToTapTexts MobileMethod = "swipe_to_tap_texts" // swipe up & down to find text and tap )
const ( TextBackspace string = "\u0008" TextDelete string = "\u007F" )
Variables ¶
var ( AdbServerHost = "localhost" AdbServerPort = gadb.AdbServerPort // 5037 UIA2ServerPort = 6790 DeviceTempPath = "/data/local/tmp" )
var ( DefaultWaitTimeout = 60 * time.Second DefaultWaitInterval = 400 * time.Millisecond )
Functions ¶
func DeviceList ¶
func NewUIADriver ¶
func NewUIADriver(capabilities Capabilities, urlPrefix string) (driver *uiaDriver, err error)
Types ¶
type ActionOption ¶
type ActionOption func(o *MobileAction)
func WithCustomDirection ¶
func WithCustomDirection(sx, sy, ex, ey float64) ActionOption
WithCustomDirection inputs sx, sy, ex, ey
func WithDescription ¶
func WithDescription(description string) ActionOption
func WithDirection ¶
func WithDirection(direction string) ActionOption
WithDirection inputs direction (up, down, left, right)
func WithID ¶
func WithID(id string) ActionOption
func WithIdentifier ¶
func WithIdentifier(identifier string) ActionOption
func WithIgnoreNotFoundError ¶
func WithIgnoreNotFoundError(ignoreError bool) ActionOption
func WithIndex ¶
func WithIndex(index int) ActionOption
func WithMaxRetryTimes ¶
func WithMaxRetryTimes(maxRetryTimes int) ActionOption
func WithOffset ¶
func WithOffset(offsetX, offsetY int) ActionOption
func WithScope ¶
func WithScope(x1, y1, x2, y2 float64) ActionOption
WithScope inputs area of [(x1,y1), (x2,y2)]
func WithText ¶
func WithText(text string) ActionOption
func WithTimeout ¶
func WithTimeout(timeout int) ActionOption
func WithWaitTime ¶
func WithWaitTime(sec float64) ActionOption
type AlertAction ¶
type AlertAction string
const ( AlertActionAccept AlertAction = "accept" AlertActionDismiss AlertAction = "dismiss" )
type AndroidDevice ¶
type AndroidDevice struct { SerialNumber string `json:"serial,omitempty" yaml:"serial,omitempty"` IP string `json:"ip,omitempty" yaml:"ip,omitempty"` Port int `json:"port,omitempty" yaml:"port,omitempty"` MjpegPort int `json:"mjpeg_port,omitempty" yaml:"mjpeg_port,omitempty"` LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"` // contains filtered or unexported fields }
func NewAndroidDevice ¶
func NewAndroidDevice(options ...AndroidDeviceOption) (device *AndroidDevice, err error)
func (*AndroidDevice) NewDriver ¶
func (dev *AndroidDevice) NewDriver(capabilities Capabilities) (driverExt *DriverExt, err error)
func (*AndroidDevice) NewHTTPDriver ¶
func (dev *AndroidDevice) NewHTTPDriver(capabilities Capabilities) (driver *uiaDriver, err error)
NewHTTPDriver creates new remote HTTP client, this will also start a new session. TODO: replace uiaDriver with WebDriver
func (*AndroidDevice) NewUSBDriver ¶
func (dev *AndroidDevice) NewUSBDriver(capabilities Capabilities) (driver *uiaDriver, err error)
NewUSBDriver creates new client via USB connected device, this will also start a new session. TODO: replace uiaDriver with WebDriver
func (*AndroidDevice) UUID ¶
func (dev *AndroidDevice) UUID() string
type AndroidDeviceOption ¶
type AndroidDeviceOption func(*AndroidDevice)
func GetAndroidDeviceOptions ¶
func GetAndroidDeviceOptions(dev *AndroidDevice) (deviceOptions []AndroidDeviceOption)
func WithAdbIP ¶
func WithAdbIP(ip string) AndroidDeviceOption
func WithAdbLogOn ¶
func WithAdbLogOn(logOn bool) AndroidDeviceOption
func WithAdbPort ¶
func WithAdbPort(port int) AndroidDeviceOption
func WithSerialNumber ¶
func WithSerialNumber(serial string) AndroidDeviceOption
type AppBaseInfo ¶
type AppInfo ¶
type AppInfo struct { ProcessArguments struct { Env interface{} `json:"env"` Args []interface{} `json:"args"` } `json:"processArguments"` Name string `json:"name"` AppBaseInfo }
type AppLaunchOption ¶
type AppLaunchOption map[string]interface{}
AppLaunchOption Configure app launch parameters
func NewAppLaunchOption ¶
func NewAppLaunchOption() AppLaunchOption
func (AppLaunchOption) WithArguments ¶
func (opt AppLaunchOption) WithArguments(args []string) AppLaunchOption
WithArguments The optional array of application command line arguments. The arguments are going to be applied if the application was not running before.
func (AppLaunchOption) WithBundleId ¶
func (opt AppLaunchOption) WithBundleId(bundleId string) AppLaunchOption
func (AppLaunchOption) WithBySelector ¶
func (opt AppLaunchOption) WithBySelector(bySelector ...BySelector) AppLaunchOption
func (AppLaunchOption) WithEnvironment ¶
func (opt AppLaunchOption) WithEnvironment(env map[string]string) AppLaunchOption
WithEnvironment The optional dictionary of environment variables for the application, which is going to be executed. The environment variables are going to be applied if the application was not running before.
func (AppLaunchOption) WithShouldWaitForQuiescence ¶
func (opt AppLaunchOption) WithShouldWaitForQuiescence(b bool) AppLaunchOption
WithShouldWaitForQuiescence whether to wait for quiescence on application startup
Defaults to `true`
type BatteryInfo ¶
type BatteryInfo struct { // Battery level in range [0.0, 1.0], where 1.0 means 100% charge. Level float64 `json:"level"` // Battery state ( 1: on battery, discharging; 2: plugged in, less than 100%, 3: plugged in, at 100% ) State BatteryState `json:"state"` Status BatteryStatus `json:"status"` }
type BatteryState ¶
type BatteryState int
const ( BatteryStateUnplugged BatteryState = iota // on battery, discharging BatteryStateCharging // plugged in, less than 100% BatteryStateFull // plugged in, at 100% )
func (BatteryState) String ¶
func (v BatteryState) String() string
type BatteryStatus ¶
type BatteryStatus int
const ( BatteryStatusUnknown BatteryStatus = iota BatteryStatusCharging BatteryStatusDischarging BatteryStatusNotCharging BatteryStatusFull )
func (BatteryStatus) String ¶
func (bs BatteryStatus) String() string
type BySelector ¶
type BySelector struct { ClassName ElementType `json:"class name"` // isSearchByIdentifier Name string `json:"name"` Id string `json:"id"` AccessibilityId string `json:"accessibility id"` // partialSearch LinkText ElementAttribute `json:"link text"` PartialLinkText ElementAttribute `json:"partial link text"` Predicate string `json:"predicate string"` ClassChain string `json:"class chain"` XPath string `json:"xpath"` // not recommended, it's slow because it is not supported by XCTest natively // Set the search criteria to match the given resource ResourceIdID. ResourceIdID string `json:"id"` // Set the search criteria to match the content-description property for a widget. ContentDescription string `json:"accessibility id"` UiAutomator string `json:"-android uiautomator"` }
performance ranking: class name > accessibility id > link text > predicate > class chain > xpath
type CVOption ¶
type CVOption func(*CVArgs)
func WithTemplateMatchMode ¶
func WithTemplateMatchMode(mode TemplateMatchMode) CVOption
func WithThreshold ¶
type Capabilities ¶
type Capabilities map[string]interface{}
func NewCapabilities ¶
func NewCapabilities() Capabilities
func (Capabilities) WithAppLaunchOption ¶
func (caps Capabilities) WithAppLaunchOption(launchOpt AppLaunchOption) Capabilities
func (Capabilities) WithDefaultAlertAction ¶
func (caps Capabilities) WithDefaultAlertAction(alertAction AlertAction) Capabilities
WithDefaultAlertAction
func (Capabilities) WithDisableAutomaticScreenshots ¶
func (caps Capabilities) WithDisableAutomaticScreenshots(b bool) Capabilities
WithDisableAutomaticScreenshots
Defaults to `true`
func (Capabilities) WithElementResponseAttributes ¶
func (caps Capabilities) WithElementResponseAttributes(s string) Capabilities
WithElementResponseAttributes If shouldUseCompactResponses == NO, is the comma-separated list of fields to return with each element.
Defaults to `type,label`.
func (Capabilities) WithEventloopIdleDelaySec ¶
func (caps Capabilities) WithEventloopIdleDelaySec(second float64) Capabilities
WithEventloopIdleDelaySec Delays the invocation of '-[XCUIApplicationProcess setEventLoopHasIdled:]' by the timer interval passed. which is skipped on setting it to zero.
func (Capabilities) WithMaxTypingFrequency ¶
func (caps Capabilities) WithMaxTypingFrequency(n int) Capabilities
WithMaxTypingFrequency
Defaults to `60`.
func (Capabilities) WithShouldTerminateApp ¶
func (caps Capabilities) WithShouldTerminateApp(b bool) Capabilities
WithShouldTerminateApp
Defaults to `true`
func (Capabilities) WithShouldUseCompactResponses ¶
func (caps Capabilities) WithShouldUseCompactResponses(b bool) Capabilities
WithShouldUseCompactResponses If set to YES will use compact (standards-compliant) & faster responses
Defaults to `true`
func (Capabilities) WithShouldUseSingletonTestManager ¶
func (caps Capabilities) WithShouldUseSingletonTestManager(b bool) Capabilities
WithShouldUseSingletonTestManager
Defaults to `true`
func (Capabilities) WithShouldUseTestManagerForVisibilityDetection ¶
func (caps Capabilities) WithShouldUseTestManagerForVisibilityDetection(b bool) Capabilities
WithShouldUseTestManagerForVisibilityDetection If set to YES will ask TestManagerDaemon for element visibility
Defaults to `false`
func (Capabilities) WithWaitForIdleTimeout ¶
func (caps Capabilities) WithWaitForIdleTimeout(second float64) Capabilities
WithWaitForIdleTimeout
Defaults to `10`
type DataOption ¶
type DataOption func(data *DataOptions)
func WithCustomOption ¶
func WithCustomOption(key string, value interface{}) DataOption
func WithDataFrequency ¶
func WithDataFrequency(frequency int) DataOption
func WithDataIdentifier ¶
func WithDataIdentifier(identifier string) DataOption
func WithDataIgnoreNotFoundError ¶
func WithDataIgnoreNotFoundError(ignoreError bool) DataOption
func WithDataIndex ¶
func WithDataIndex(index int) DataOption
func WithDataMaxRetryTimes ¶
func WithDataMaxRetryTimes(maxRetryTimes int) DataOption
func WithDataOffset ¶
func WithDataOffset(offsetX, offsetY int) DataOption
func WithDataPressDuration ¶
func WithDataPressDuration(duration float64) DataOption
func WithDataScope ¶
func WithDataScope(x1, x2, y1, y2 int) DataOption
func WithDataSteps ¶
func WithDataSteps(steps int) DataOption
func WithDataWaitTime ¶
func WithDataWaitTime(sec float64) DataOption
type DataOptions ¶
type DataOptions struct { Data map[string]interface{} // configurations used by ios/android driver Scope []int // used by ocr to get text position in the scope Offset []int // used to tap offset of point Index int // index of the target element, should start from 1 IgnoreNotFoundError bool // ignore error if target element not found MaxRetryTimes int // max retry times if target element not found Interval float64 // interval between retries in seconds }
func NewData ¶
func NewData(data map[string]interface{}, options ...DataOption) *DataOptions
type Device ¶
type Device interface { UUID() string NewDriver(capabilities Capabilities) (driverExt *DriverExt, err error) }
current implemeted device: IOSDevice, AndroidDevice
type DeviceButton ¶
type DeviceButton string
DeviceButton A physical button on an iOS device.
const ( DeviceButtonHome DeviceButton = "home" DeviceButtonVolumeUp DeviceButton = "volumeUp" DeviceButtonVolumeDown DeviceButton = "volumeDown" )
type DeviceInfo ¶
type DeviceInfo struct { TimeZone string `json:"timeZone"` CurrentLocale string `json:"currentLocale"` Model string `json:"model"` UUID string `json:"uuid"` UserInterfaceIdiom int `json:"userInterfaceIdiom"` UserInterfaceStyle string `json:"userInterfaceStyle"` Name string `json:"name"` IsSimulator bool `json:"isSimulator"` ThermalState int `json:"thermalState"` // ANDROID_ID A 64-bit number (as a hex string) that is uniquely generated when the user // first sets up the device and should remain constant for the lifetime of the user's device. The value // may change if a factory reset is performed on the device. AndroidID string `json:"androidId"` // Build.MANUFACTURER value Manufacturer string `json:"manufacturer"` // Build.BRAND value Brand string `json:"brand"` // Current running OS's API VERSION APIVersion string `json:"apiVersion"` // The current version string, for example "1.0" or "3.4b5" PlatformVersion string `json:"platformVersion"` // the name of the current celluar network carrier CarrierName string `json:"carrierName"` // the real size of the default display RealDisplaySize string `json:"realDisplaySize"` // The logical density of the display in Density Independent Pixel units. DisplayDensity int `json:"displayDensity"` // available networks Networks []networkInfo `json:"networks"` // current system locale Locale string `json:"locale"` Bluetooth struct { State string `json:"state"` } `json:"bluetooth"` }
type DeviceLogcat ¶
type DeviceLogcat struct {
// contains filtered or unexported fields
}
func NewAdbLogcat ¶
func NewAdbLogcat(serial string) *DeviceLogcat
func (*DeviceLogcat) BufferedLogcat ¶
func (l *DeviceLogcat) BufferedLogcat() (err error)
func (*DeviceLogcat) CatchLogcat ¶
func (l *DeviceLogcat) CatchLogcat() (err error)
func (*DeviceLogcat) CatchLogcatContext ¶
func (l *DeviceLogcat) CatchLogcatContext(timeoutCtx context.Context) (err error)
CatchLogcatContext starts logcat with timeout context
func (*DeviceLogcat) Errors ¶
func (l *DeviceLogcat) Errors() (err error)
func (*DeviceLogcat) Stop ¶
func (l *DeviceLogcat) Stop() error
type DeviceStatus ¶
type DeviceStatus struct { Message string `json:"message"` State string `json:"state"` OS struct { TestmanagerdVersion int `json:"testmanagerdVersion"` Name string `json:"name"` SdkVersion string `json:"sdkVersion"` Version string `json:"version"` } `json:"os"` IOS struct { IP string `json:"ip"` SimulatorVersion string `json:"simulatorVersion"` } `json:"ios"` Ready bool `json:"ready"` Build struct { Time string `json:"time"` ProductBundleIdentifier string `json:"productBundleIdentifier"` } `json:"build"` }
type DriverExt ¶
type DriverExt struct { UUID string // ios udid or android serial Driver WebDriver StartTime time.Time // used to associate screenshots name ScreenShots []string // save screenshots path CVArgs // contains filtered or unexported fields }
func (*DriverExt) CloseMjpegStream ¶
func (dExt *DriverExt) CloseMjpegStream()
func (*DriverExt) ConnectMjpegStream ¶
func (*DriverExt) DoAction ¶
func (dExt *DriverExt) DoAction(action MobileAction) error
func (*DriverExt) DoValidation ¶
func (*DriverExt) DoubleTapOffset ¶
func (*DriverExt) DoubleTapXY ¶
func (*DriverExt) DragOffset ¶
func (*DriverExt) DragOffsetFloat ¶
func (*DriverExt) FindAllImageRect ¶
func (*DriverExt) FindImageRectInUIKit ¶
func (dExt *DriverExt) FindImageRectInUIKit(imagePath string, options ...DataOption) (x, y, width, height float64, err error)
func (*DriverExt) FindTextByOCR ¶
func (dExt *DriverExt) FindTextByOCR(ocrText string, options ...DataOption) (x, y, width, height float64, err error)
func (*DriverExt) FindTextsByOCR ¶
func (dExt *DriverExt) FindTextsByOCR(ocrTexts []string, options ...DataOption) (points [][]float64, err error)
func (*DriverExt) FindUIElement ¶
func (dExt *DriverExt) FindUIElement(param string) (ele WebElement, err error)
func (*DriverExt) FindUIRectInUIKit ¶
func (dExt *DriverExt) FindUIRectInUIKit(search string, options ...DataOption) (x, y, width, height float64, err error)
func (*DriverExt) ForceTouch ¶
func (*DriverExt) ForceTouchOffset ¶
func (*DriverExt) GetImageXY ¶
func (dExt *DriverExt) GetImageXY(imagePath string, options ...DataOption) (point PointF, err error)
func (*DriverExt) GetPerfData ¶
func (*DriverExt) GetTextXY ¶
func (dExt *DriverExt) GetTextXY(ocrText string, options ...DataOption) (point PointF, err error)
func (*DriverExt) GetTextXYs ¶
func (dExt *DriverExt) GetTextXYs(ocrText []string, options ...DataOption) (points []PointF, err error)
func (*DriverExt) IsImageExist ¶
func (*DriverExt) IsLabelExist ¶
func (*DriverExt) IsNameExist ¶
func (*DriverExt) IsOCRExist ¶
func (*DriverExt) LoopUntil ¶
func (dExt *DriverExt) LoopUntil(findAction, findCondition, foundAction Action, options ...DataOption) error
func (*DriverExt) MappingToRectInUIKit ¶
func (*DriverExt) PerformActions ¶
func (dExt *DriverExt) PerformActions(actions *W3CActions) error
func (*DriverExt) PerformTouchActions ¶
func (dExt *DriverExt) PerformTouchActions(touchActions *TouchActions) error
func (*DriverExt) ScreenShot ¶
ScreenShot takes screenshot and saves image file to $CWD/screenshots/ folder
func (*DriverExt) SwipeDown ¶
func (dExt *DriverExt) SwipeDown(options ...DataOption) (err error)
func (*DriverExt) SwipeLeft ¶
func (dExt *DriverExt) SwipeLeft(options ...DataOption) (err error)
func (*DriverExt) SwipeRelative ¶
func (dExt *DriverExt) SwipeRelative(fromX, fromY, toX, toY float64, options ...DataOption) error
SwipeRelative swipe from relative position [fromX, fromY] to relative position [toX, toY]
func (*DriverExt) SwipeRight ¶
func (dExt *DriverExt) SwipeRight(options ...DataOption) (err error)
func (*DriverExt) SwipeTo ¶
func (dExt *DriverExt) SwipeTo(direction string, options ...DataOption) (err error)
func (*DriverExt) SwipeUntil ¶
func (dExt *DriverExt) SwipeUntil(direction interface{}, findCondition Action, foundAction Action, options ...DataOption) error
findCondition indicates the condition to find a UI element foundAction indicates the action to do after a UI element is found
func (*DriverExt) SwipeUp ¶
func (dExt *DriverExt) SwipeUp(options ...DataOption) (err error)
func (*DriverExt) TapAbsXY ¶
func (dExt *DriverExt) TapAbsXY(x, y float64, options ...DataOption) error
func (*DriverExt) TapByCV ¶
func (dExt *DriverExt) TapByCV(imagePath string, options ...DataOption) error
func (*DriverExt) TapByOCR ¶
func (dExt *DriverExt) TapByOCR(ocrText string, options ...DataOption) error
func (*DriverExt) TapOffset ¶
func (dExt *DriverExt) TapOffset(param string, xOffset, yOffset float64, options ...DataOption) (err error)
func (*DriverExt) TapWithNumber ¶
TapWithNumber sends one or more taps
func (*DriverExt) TapWithNumberOffset ¶
func (*DriverExt) TouchAndHold ¶
type ElementAttribute ¶
type ElementAttribute map[string]interface{}
func NewElementAttribute ¶
func NewElementAttribute() ElementAttribute
func (ElementAttribute) String ¶
func (ea ElementAttribute) String() string
func (ElementAttribute) WithAccessibilityContainer ¶
func (ea ElementAttribute) WithAccessibilityContainer(b bool) ElementAttribute
WithAccessibilityContainer Whether element is an accessibility container (contains children of any depth that are accessible)
func (ElementAttribute) WithAccessible ¶
func (ea ElementAttribute) WithAccessible(b bool) ElementAttribute
WithAccessible Whether element is accessible
func (ElementAttribute) WithEnabled ¶
func (ea ElementAttribute) WithEnabled(b bool) ElementAttribute
WithEnabled Whether element is enabled
func (ElementAttribute) WithLabel ¶
func (ea ElementAttribute) WithLabel(s string) ElementAttribute
WithLabel Element's label
func (ElementAttribute) WithName ¶
func (ea ElementAttribute) WithName(s string) ElementAttribute
WithName Element's name
func (ElementAttribute) WithSelected ¶
func (ea ElementAttribute) WithSelected(b bool) ElementAttribute
WithSelected Element's selected state
func (ElementAttribute) WithType ¶
func (ea ElementAttribute) WithType(elemType ElementType) ElementAttribute
WithType Element's type
func (ElementAttribute) WithUID ¶
func (ea ElementAttribute) WithUID(uid string) ElementAttribute
WithUID Element's unique identifier
func (ElementAttribute) WithValue ¶
func (ea ElementAttribute) WithValue(s string) ElementAttribute
WithValue Element's value
func (ElementAttribute) WithVisible ¶
func (ea ElementAttribute) WithVisible(b bool) ElementAttribute
WithVisible
Whether element is visible
type ElementType ¶
type ElementType struct { Any bool `json:"XCUIElementTypeAny"` Other bool `json:"XCUIElementTypeOther"` Application bool `json:"XCUIElementTypeApplication"` Group bool `json:"XCUIElementTypeGroup"` Window bool `json:"XCUIElementTypeWindow"` Sheet bool `json:"XCUIElementTypeSheet"` Drawer bool `json:"XCUIElementTypeDrawer"` Alert bool `json:"XCUIElementTypeAlert"` Dialog bool `json:"XCUIElementTypeDialog"` Button bool `json:"XCUIElementTypeButton"` RadioButton bool `json:"XCUIElementTypeRadioButton"` RadioGroup bool `json:"XCUIElementTypeRadioGroup"` CheckBox bool `json:"XCUIElementTypeCheckBox"` DisclosureTriangle bool `json:"XCUIElementTypeDisclosureTriangle"` PopUpButton bool `json:"XCUIElementTypePopUpButton"` ComboBox bool `json:"XCUIElementTypeComboBox"` MenuButton bool `json:"XCUIElementTypeMenuButton"` ToolbarButton bool `json:"XCUIElementTypeToolbarButton"` Popover bool `json:"XCUIElementTypePopover"` Keyboard bool `json:"XCUIElementTypeKeyboard"` Key bool `json:"XCUIElementTypeKey"` TabBar bool `json:"XCUIElementTypeTabBar"` TabGroup bool `json:"XCUIElementTypeTabGroup"` Toolbar bool `json:"XCUIElementTypeToolbar"` StatusBar bool `json:"XCUIElementTypeStatusBar"` Table bool `json:"XCUIElementTypeTable"` TableRow bool `json:"XCUIElementTypeTableRow"` TableColumn bool `json:"XCUIElementTypeTableColumn"` Outline bool `json:"XCUIElementTypeOutline"` OutlineRow bool `json:"XCUIElementTypeOutlineRow"` Browser bool `json:"XCUIElementTypeBrowser"` CollectionView bool `json:"XCUIElementTypeCollectionView"` Slider bool `json:"XCUIElementTypeSlider"` PageIndicator bool `json:"XCUIElementTypePageIndicator"` ProgressIndicator bool `json:"XCUIElementTypeProgressIndicator"` ActivityIndicator bool `json:"XCUIElementTypeActivityIndicator"` SegmentedControl bool `json:"XCUIElementTypeSegmentedControl"` Picker bool `json:"XCUIElementTypePicker"` PickerWheel bool `json:"XCUIElementTypePickerWheel"` Switch bool `json:"XCUIElementTypeSwitch"` Toggle bool `json:"XCUIElementTypeToggle"` Link bool `json:"XCUIElementTypeLink"` Image bool `json:"XCUIElementTypeImage"` Icon bool `json:"XCUIElementTypeIcon"` SearchField bool `json:"XCUIElementTypeSearchField"` ScrollView bool `json:"XCUIElementTypeScrollView"` ScrollBar bool `json:"XCUIElementTypeScrollBar"` StaticText bool `json:"XCUIElementTypeStaticText"` TextField bool `json:"XCUIElementTypeTextField"` SecureTextField bool `json:"XCUIElementTypeSecureTextField"` DatePicker bool `json:"XCUIElementTypeDatePicker"` TextView bool `json:"XCUIElementTypeTextView"` Menu bool `json:"XCUIElementTypeMenu"` MenuItem bool `json:"XCUIElementTypeMenuItem"` MenuBar bool `json:"XCUIElementTypeMenuBar"` MenuBarItem bool `json:"XCUIElementTypeMenuBarItem"` Map bool `json:"XCUIElementTypeMap"` WebView bool `json:"XCUIElementTypeWebView"` IncrementArrow bool `json:"XCUIElementTypeIncrementArrow"` DecrementArrow bool `json:"XCUIElementTypeDecrementArrow"` Timeline bool `json:"XCUIElementTypeTimeline"` RatingIndicator bool `json:"XCUIElementTypeRatingIndicator"` ValueIndicator bool `json:"XCUIElementTypeValueIndicator"` SplitGroup bool `json:"XCUIElementTypeSplitGroup"` Splitter bool `json:"XCUIElementTypeSplitter"` RelevanceIndicator bool `json:"XCUIElementTypeRelevanceIndicator"` ColorWell bool `json:"XCUIElementTypeColorWell"` HelpTag bool `json:"XCUIElementTypeHelpTag"` Matte bool `json:"XCUIElementTypeMatte"` DockItem bool `json:"XCUIElementTypeDockItem"` Ruler bool `json:"XCUIElementTypeRuler"` RulerMarker bool `json:"XCUIElementTypeRulerMarker"` Grid bool `json:"XCUIElementTypeGrid"` LevelIndicator bool `json:"XCUIElementTypeLevelIndicator"` Cell bool `json:"XCUIElementTypeCell"` LayoutArea bool `json:"XCUIElementTypeLayoutArea"` LayoutItem bool `json:"XCUIElementTypeLayoutItem"` Handle bool `json:"XCUIElementTypeHandle"` Stepper bool `json:"XCUIElementTypeStepper"` Tab bool `json:"XCUIElementTypeTab"` TouchBar bool `json:"XCUIElementTypeTouchBar"` StatusItem bool `json:"XCUIElementTypeStatusItem"` EditText bool `json:"android.widget.EditText"` }
ElementType !!! This mapping should be updated if there are changes after each new XCTest release"`
func (ElementType) String ¶
func (et ElementType) String() string
type EventPageID ¶
type EventPageID int
EventPageID The event page identifier
const EventPageIDConsumer EventPageID = 0x0C
type EventUsageID ¶
type EventUsageID int
EventUsageID The event usage identifier (usages are defined per-page)
const ( EventUsageIDCsmrVolumeUp EventUsageID = 0xE9 EventUsageIDCsmrVolumeDown EventUsageID = 0xEA EventUsageIDCsmrHome EventUsageID = 0x40 EventUsageIDCsmrPower EventUsageID = 0x30 EventUsageIDCsmrSnapshot EventUsageID = 0x65 // Power + Home )
type ExportPoint ¶
type ExportPoint struct { Start int `json:"start" yaml:"start"` End int `json:"end" yaml:"end"` From interface{} `json:"from" yaml:"from"` To interface{} `json:"to" yaml:"to"` Operation string `json:"operation" yaml:"operation"` Ext string `json:"ext" yaml:"ext"` RunTime int `json:"run_time,omitempty" yaml:"run_time,omitempty"` }
func ConvertPoints ¶
func ConvertPoints(data string) (eps []ExportPoint)
type FingerAction ¶
type FingerAction []map[string]interface{}
func NewFingerAction ¶
func NewFingerAction(capacity ...int) *FingerAction
func (*FingerAction) Down ¶
func (fa *FingerAction) Down() *FingerAction
func (*FingerAction) Move ¶
func (fa *FingerAction) Move(fm FingerMove) *FingerAction
func (*FingerAction) Pause ¶
func (fa *FingerAction) Pause(second ...float64) *FingerAction
func (*FingerAction) Up ¶
func (fa *FingerAction) Up() *FingerAction
type FingerMove ¶
type FingerMove map[string]interface{}
func NewFingerMove ¶
func NewFingerMove() FingerMove
func (FingerMove) WithDuration ¶
func (fm FingerMove) WithDuration(second float64) FingerMove
func (FingerMove) WithOrigin ¶
func (fm FingerMove) WithOrigin(element WebElement) FingerMove
func (FingerMove) WithXY ¶
func (fm FingerMove) WithXY(x, y int) FingerMove
func (FingerMove) WithXYFloat ¶
func (fm FingerMove) WithXYFloat(x, y float64) FingerMove
type IOSDevice ¶
type IOSDevice struct { PerfOptions *gidevice.PerfOptions `json:"perf_options,omitempty" yaml:"perf_options,omitempty"` UDID string `json:"udid,omitempty" yaml:"udid,omitempty"` Port int `json:"port,omitempty" yaml:"port,omitempty"` // WDA remote port MjpegPort int `json:"mjpeg_port,omitempty" yaml:"mjpeg_port,omitempty"` // WDA remote MJPEG port LogOn bool `json:"log_on,omitempty" yaml:"log_on,omitempty"` // switch to iOS springboard before init WDA session ResetHomeOnStartup bool `json:"reset_home_on_startup,omitempty" yaml:"reset_home_on_startup,omitempty"` // config appium settings SnapshotMaxDepth int `json:"snapshot_max_depth,omitempty" yaml:"snapshot_max_depth,omitempty"` AcceptAlertButtonSelector string `json:"accept_alert_button_selector,omitempty" yaml:"accept_alert_button_selector,omitempty"` DismissAlertButtonSelector string `json:"dismiss_alert_button_selector,omitempty" yaml:"dismiss_alert_button_selector,omitempty"` // contains filtered or unexported fields }
func NewIOSDevice ¶
func NewIOSDevice(options ...IOSDeviceOption) (device *IOSDevice, err error)
func (*IOSDevice) NewDriver ¶
func (dev *IOSDevice) NewDriver(capabilities Capabilities) (driverExt *DriverExt, err error)
func (*IOSDevice) NewHTTPDriver ¶
func (dev *IOSDevice) NewHTTPDriver(capabilities Capabilities) (driver WebDriver, err error)
NewHTTPDriver creates new remote HTTP client, this will also start a new session.
func (*IOSDevice) NewUSBDriver ¶
func (dev *IOSDevice) NewUSBDriver(capabilities Capabilities) (driver WebDriver, err error)
NewUSBDriver creates new client via USB connected device, this will also start a new session.
type IOSDeviceOption ¶
type IOSDeviceOption func(*IOSDevice)
func GetIOSDeviceOptions ¶
func GetIOSDeviceOptions(dev *IOSDevice) (deviceOptions []IOSDeviceOption)
func WithAcceptAlertButtonSelector ¶
func WithAcceptAlertButtonSelector(selector string) IOSDeviceOption
func WithDismissAlertButtonSelector ¶
func WithDismissAlertButtonSelector(selector string) IOSDeviceOption
func WithLogOn ¶
func WithLogOn(logOn bool) IOSDeviceOption
func WithPerfOptions ¶
func WithPerfOptions(options ...gidevice.PerfOption) IOSDeviceOption
func WithResetHomeOnStartup ¶
func WithResetHomeOnStartup(reset bool) IOSDeviceOption
func WithSnapshotMaxDepth ¶
func WithSnapshotMaxDepth(depth int) IOSDeviceOption
func WithUDID ¶
func WithUDID(udid string) IOSDeviceOption
func WithWDAMjpegPort ¶
func WithWDAMjpegPort(port int) IOSDeviceOption
func WithWDAPort ¶
func WithWDAPort(port int) IOSDeviceOption
type KeyCode ¶
type KeyCode int
const ( // KCSoftLeft Soft Left key // Usually situated below the display on phones and used as a multi-function // feature key for selecting a software defined function shown on the bottom left // of the display. KCSoftLeft KeyCode = 1 // KCSoftRight Soft Right key. // Usually situated below the display on phones and used as a multi-function // feature key for selecting a software defined function shown on the bottom right // of the display. KCSoftRight KeyCode = 2 // KCHome Home key. // This key is handled by the framework and is never delivered to applications. KCHome KeyCode = 3 KCBack KeyCode = 4 // Back key KCCall KeyCode = 5 // Call key KCEndCall KeyCode = 6 // End Call key KC0 KeyCode = 7 // '0' key KC1 KeyCode = 8 // '1' key KC2 KeyCode = 9 // '2' key KC3 KeyCode = 10 // '3' key KC4 KeyCode = 11 // '4' key KC5 KeyCode = 12 // '5' key KC6 KeyCode = 13 // '6' key KC7 KeyCode = 14 // '7' key KC8 KeyCode = 15 // '8' key KC9 KeyCode = 16 // '9' key KCStar KeyCode = 17 // '*' key KCPound KeyCode = 18 // '#' key // KCDPadUp KeycodeDPadUp Directional Pad Up key. // May also be synthesized from trackball motions. KCDPadUp KeyCode = 19 // KCDPadDown Directional Pad Down key. // May also be synthesized from trackball motions. KCDPadDown KeyCode = 20 // KCDPadLeft Directional Pad Left key. // May also be synthesized from trackball motions. KCDPadLeft KeyCode = 21 // KCDPadRight Directional Pad Right key. // May also be synthesized from trackball motions. KCDPadRight KeyCode = 22 // KCDPadCenter Directional Pad Center key. // May also be synthesized from trackball motions. KCDPadCenter KeyCode = 23 // KCVolumeUp Volume Up key. // Adjusts the speaker volume up. KCVolumeUp KeyCode = 24 // KCVolumeDown Volume Down key. // Adjusts the speaker volume down. KCVolumeDown KeyCode = 25 // KCPower Power key. KCPower KeyCode = 26 // KCCamera Camera key. // Used to launch a camera application or take pictures. KCCamera KeyCode = 27 KCClear KeyCode = 28 // Clear key KCa KeyCode = 29 // 'a' key KCb KeyCode = 30 // 'b' key KCc KeyCode = 31 // 'c' key KCd KeyCode = 32 // 'd' key KCe KeyCode = 33 // 'e' key KCf KeyCode = 34 // 'f' key KCg KeyCode = 35 // 'g' key KCh KeyCode = 36 // 'h' key KCi KeyCode = 37 // 'i' key KCj KeyCode = 38 // 'j' key KCk KeyCode = 39 // 'k' key KCl KeyCode = 40 // 'l' key KCm KeyCode = 41 // 'm' key KCn KeyCode = 42 // 'n' key KCo KeyCode = 43 // 'o' key KCp KeyCode = 44 // 'p' key KCq KeyCode = 45 // 'q' key KCr KeyCode = 46 // 'r' key KCs KeyCode = 47 // 's' key KCt KeyCode = 48 // 't' key KCu KeyCode = 49 // 'u' key KCv KeyCode = 50 // 'v' key KCw KeyCode = 51 // 'w' key KCx KeyCode = 52 // 'x' key KCy KeyCode = 53 // 'y' key KCz KeyCode = 54 // 'z' key KCComma KeyCode = 55 // ',' key KCPeriod KeyCode = 56 // '.' key KCAltLeft KeyCode = 57 // Left Alt modifier key KCAltRight KeyCode = 58 // Right Alt modifier key KCShiftLeft KeyCode = 59 // Left Shift modifier key KCShiftRight KeyCode = 60 // Right Shift modifier key KCTab KeyCode = 61 // Tab key KCSpace KeyCode = 62 // Space key // KCSym Symbol modifier key. // Used to enter alternate symbols. KCSym KeyCode = 63 // KCExplorer Explorer special function key. // Used to launch a browser application. KCExplorer KeyCode = 64 // KCEnvelope Envelope special function key. // Used to launch a mail application. KCEnvelope KeyCode = 65 // KCEnter Enter key. KCEnter KeyCode = 66 // KCDel Backspace key. // Deletes characters before the insertion point, unlike `KCForwardDel`. KCDel KeyCode = 67 KCGrave KeyCode = 68 // '`' (backtick) key KCMinus KeyCode = 69 // '-' KCEquals KeyCode = 70 // '=' key KCLeftBracket KeyCode = 71 // '[' key KCRightBracket KeyCode = 72 // ']' key KCBackslash KeyCode = 73 // '\' key KCSemicolon KeyCode = 74 // ” key KCApostrophe KeyCode = 75 // ”' (apostrophe) key KCSlash KeyCode = 76 // '/' key KCAt KeyCode = 77 // '@' key // KCNum Number modifier key. // Used to enter numeric symbols. // This key is not Num Lock; it is more like `KCAltLeft` and is // interpreted as an ALT key by {@link android.text.method.MetaKeyKeyListener}. KCNum KeyCode = 78 // KCHeadsetHook Headset Hook key. // Used to hang up calls and stop media. KCHeadsetHook KeyCode = 79 // KCFocus Camera Focus key. // Used to focus the camera. // *Camera* focus KCFocus KeyCode = 80 KCPlus KeyCode = 81 // '+' key. KCMenu KeyCode = 82 // Menu key. KCNotification KeyCode = 83 // Notification key. KCSearch KeyCode = 84 // Search key. KCMediaPlayPause KeyCode = 85 // Play/Pause media key. KCMediaStop KeyCode = 86 // Stop media key. KCMediaNext KeyCode = 87 // Play Next media key. KCMediaPrevious KeyCode = 88 // Play Previous media key. KCMediaRewind KeyCode = 89 // Rewind media key. KCMediaFastForward KeyCode = 90 // Fast Forward media key. // KCMute Mute key. // Mutes the microphone, unlike `KCVolumeMute` KCMute KeyCode = 91 // KCPageUp Page Up key. KCPageUp KeyCode = 92 // KCPageDown Page Down key. KCPageDown KeyCode = 93 // KCPictSymbols Picture Symbols modifier key. // Used to switch symbol sets (Emoji, Kao-moji). // switch symbol-sets (Emoji,Kao-moji) KCPictSymbols KeyCode = 94 // KCSwitchCharset Switch Charset modifier key. // Used to switch character sets (Kanji, Katakana). // switch char-sets (Kanji,Katakana) KCSwitchCharset KeyCode = 95 // KCButtonA A Button key. // On a game controller, the A button should be either the button labeled A // or the first button on the bottom row of controller buttons. KCButtonA KeyCode = 96 // KCButtonB B Button key. // On a game controller, the B button should be either the button labeled B // or the second button on the bottom row of controller buttons. KCButtonB KeyCode = 97 // KCButtonC C Button key. // On a game controller, the C button should be either the button labeled C // or the third button on the bottom row of controller buttons. KCButtonC KeyCode = 98 // KCButtonX X Button key. // On a game controller, the X button should be either the button labeled X // or the first button on the upper row of controller buttons. KCButtonX KeyCode = 99 // KCButtonY Y Button key. // On a game controller, the Y button should be either the button labeled Y // or the second button on the upper row of controller buttons. KCButtonY KeyCode = 100 // KCButtonZ Z Button key. // On a game controller, the Z button should be either the button labeled Z // or the third button on the upper row of controller buttons. KCButtonZ KeyCode = 101 // KCButtonL1 L1 Button key. // On a game controller, the L1 button should be either the button labeled L1 (or L) // or the top left trigger button. KCButtonL1 KeyCode = 102 // KCButtonR1 R1 Button key. // On a game controller, the R1 button should be either the button labeled R1 (or R) // or the top right trigger button. KCButtonR1 KeyCode = 103 // KCButtonL2 L2 Button key. // On a game controller, the L2 button should be either the button labeled L2 // or the bottom left trigger button. KCButtonL2 KeyCode = 104 // KCButtonR2 R2 Button key. // On a game controller, the R2 button should be either the button labeled R2 // or the bottom right trigger button. KCButtonR2 KeyCode = 105 // KCButtonTHUMBL Left Thumb Button key. // On a game controller, the left thumb button indicates that the left (or only) // joystick is pressed. KCButtonTHUMBL KeyCode = 106 // KCButtonTHUMBR Right Thumb Button key. // On a game controller, the right thumb button indicates that the right // joystick is pressed. KCButtonTHUMBR KeyCode = 107 // KCButtonStart Start Button key. // On a game controller, the button labeled Start. KCButtonStart KeyCode = 108 // KCButtonSelect Select Button key. // On a game controller, the button labeled Select. KCButtonSelect KeyCode = 109 // KCButtonMode Mode Button key. // On a game controller, the button labeled Mode. KCButtonMode KeyCode = 110 // KCEscape Escape key. KCEscape KeyCode = 111 // KCForwardDel Forward Delete key. // Deletes characters ahead of the insertion point, unlike `KCDel`. KCForwardDel KeyCode = 112 KCCtrlLeft KeyCode = 113 // Left Control modifier key KCCtrlRight KeyCode = 114 // Right Control modifier key KCCapsLock KeyCode = 115 // Caps Lock key KCScrollLock KeyCode = 116 // Scroll Lock key KCMetaLeft KeyCode = 117 // Left Meta modifier key KCMetaRight KeyCode = 118 // Right Meta modifier key KCFunction KeyCode = 119 // Function modifier key KCSysRq KeyCode = 120 // System Request / Print Screen key KCBreak KeyCode = 121 // Break / Pause key // KCMoveHome Home Movement key. // Used for scrolling or moving the cursor around to the start of a line // or to the top of a list. KCMoveHome KeyCode = 122 // KCMoveEnd End Movement key. // Used for scrolling or moving the cursor around to the end of a line // or to the bottom of a list. KCMoveEnd KeyCode = 123 // KCInsert Insert key. // Toggles insert / overwrite edit mode. KCInsert KeyCode = 124 // KCForward Forward key. // Navigates forward in the history stack. Complement of `KCBack`. KCForward KeyCode = 125 // KCMediaPlay Play media key. KCMediaPlay KeyCode = 126 // KCMediaPause Pause media key. KCMediaPause KeyCode = 127 // KCMediaClose Close media key. // May be used to close a CD tray, for example. KCMediaClose KeyCode = 128 // KCMediaEject Eject media key. // May be used to eject a CD tray, for example. KCMediaEject KeyCode = 129 // KCMediaRecord Record media key. KCMediaRecord KeyCode = 130 KCF1 KeyCode = 131 // F1 key. KCF2 KeyCode = 132 // F2 key. KCF3 KeyCode = 133 // F3 key. KCF4 KeyCode = 134 // F4 key. KCF5 KeyCode = 135 // F5 key. KCF6 KeyCode = 136 // F6 key. KCF7 KeyCode = 137 // F7 key. KCF8 KeyCode = 138 // F8 key. KCF9 KeyCode = 139 // F9 key. KCF10 KeyCode = 140 // F10 key. KCF11 KeyCode = 141 // F11 key. KCF12 KeyCode = 142 // F12 key. // KCNumLock Num Lock key. // This is the Num Lock key; it is different from `KCNum`. // This key alters the behavior of other keys on the numeric keypad. KCNumLock KeyCode = 143 KCNumpad0 KeyCode = 144 // Numeric keypad '0' key KCNumpad1 KeyCode = 145 // Numeric keypad '1' key KCNumpad2 KeyCode = 146 // Numeric keypad '2' key KCNumpad3 KeyCode = 147 // Numeric keypad '3' key KCNumpad4 KeyCode = 148 // Numeric keypad '4' key KCNumpad5 KeyCode = 149 // Numeric keypad '5' key KCNumpad6 KeyCode = 150 // Numeric keypad '6' key KCNumpad7 KeyCode = 151 // Numeric keypad '7' key KCNumpad8 KeyCode = 152 // Numeric keypad '8' key KCNumpad9 KeyCode = 153 // Numeric keypad '9' key KCNumpadDivide KeyCode = 154 // Numeric keypad '/' key (for division) KCNumpadMultiply KeyCode = 155 // Numeric keypad '*' key (for multiplication) KCNumpadSubtract KeyCode = 156 // Numeric keypad '-' key (for subtraction) KCNumpadAdd KeyCode = 157 // Numeric keypad '+' key (for addition) KCNumpadDot KeyCode = 158 // Numeric keypad '.' key (for decimals or digit grouping) KCNumpadComma KeyCode = 159 // Numeric keypad ',' key (for decimals or digit grouping) KCNumpadEnter KeyCode = 160 // Numeric keypad Enter key KCNumpadEquals KeyCode = 161 // Numeric keypad 'KeyCode =' key KCNumpadLeftParen KeyCode = 162 // Numeric keypad '(' key KCNumpadRightParen KeyCode = 163 // Numeric keypad ')' key // KCVolumeMute Volume Mute key. // Mutes the speaker, unlike `KCMute`. // This key should normally be implemented as a toggle such that the first press // mutes the speaker and the second press restores the original volume. KCVolumeMute KeyCode = 164 // KCInfo Info key. // Common on TV remotes to show additional information related to what is // currently being viewed. KCInfo KeyCode = 165 // KCChannelUp Channel up key. // On TV remotes, increments the television channel. KCChannelUp KeyCode = 166 // KCChannelDown Channel down key. // On TV remotes, decrements the television channel. KCChannelDown KeyCode = 167 // KCZoomIn Zoom in key. KCZoomIn KeyCode = 168 // KCZoomOut Zoom out key. KCZoomOut KeyCode = 169 // KCTv TV key. // On TV remotes, switches to viewing live TV. KCTv KeyCode = 170 // KCWindow Window key. // On TV remotes, toggles picture-in-picture mode or other windowing functions. // On Android Wear devices, triggers a display offset. KCWindow KeyCode = 171 // KCGuide Guide key. // On TV remotes, shows a programming guide. KCGuide KeyCode = 172 // KCDvr DVR key. // On some TV remotes, switches to a DVR mode for recorded shows. KCDvr KeyCode = 173 // KCBookmark Bookmark key. // On some TV remotes, bookmarks content or web pages. KCBookmark KeyCode = 174 // KCCaptions Toggle captions key. // Switches the mode for closed-captioning text, for example during television shows. KCCaptions KeyCode = 175 // KCSettings Settings key. // Starts the system settings activity. KCSettings KeyCode = 176 // KCTvPower TV power key. // On TV remotes, toggles the power on a television screen. KCTvPower KeyCode = 177 // KCTvInput TV input key. // On TV remotes, switches the input on a television screen. KCTvInput KeyCode = 178 // KCStbPower Set-top-box power key. // On TV remotes, toggles the power on an external Set-top-box. KCStbPower KeyCode = 179 // KCStbInput Set-top-box input key. // On TV remotes, switches the input mode on an external Set-top-box. KCStbInput KeyCode = 180 // KCAvrPower A/V Receiver power key. // On TV remotes, toggles the power on an external A/V Receiver. KCAvrPower KeyCode = 181 // KCAvrInput A/V Receiver input key. // On TV remotes, switches the input mode on an external A/V Receiver. KCAvrInput KeyCode = 182 // KCProgRed Red "programmable" key. // On TV remotes, acts as a contextual/programmable key. KCProgRed KeyCode = 183 // KCProgGreen Green "programmable" key. // On TV remotes, actsas a contextual/programmable key. KCProgGreen KeyCode = 184 // KCProgYellow Yellow "programmable" key. // On TV remotes, acts as a contextual/programmable key. KCProgYellow KeyCode = 185 // KCProgBlue Blue "programmable" key. // On TV remotes, acts as a contextual/programmable key. KCProgBlue KeyCode = 186 // KCAppSwitch App switch key. // Should bring up the application switcher dialog. KCAppSwitch KeyCode = 187 KCButton1 KeyCode = 188 // Generic Game Pad Button #1 KCButton2 KeyCode = 189 // Generic Game Pad Button #2 KCButton3 KeyCode = 190 // Generic Game Pad Button #3 KCButton4 KeyCode = 191 // Generic Game Pad Button #4 KCButton5 KeyCode = 192 // Generic Game Pad Button #5 KCButton6 KeyCode = 193 // Generic Game Pad Button #6 KCButton7 KeyCode = 194 // Generic Game Pad Button #7 KCButton8 KeyCode = 195 // Generic Game Pad Button #8 KCButton9 KeyCode = 196 // Generic Game Pad Button #9 KCButton10 KeyCode = 197 // Generic Game Pad Button #10 KCButton11 KeyCode = 198 // Generic Game Pad Button #11 KCButton12 KeyCode = 199 // Generic Game Pad Button #12 KCButton13 KeyCode = 200 // Generic Game Pad Button #13 KCButton14 KeyCode = 201 // Generic Game Pad Button #14 KCButton15 KeyCode = 202 // Generic Game Pad Button #15 KCButton16 KeyCode = 203 // Generic Game Pad Button #16 // KCLanguageSwitch Language Switch key. // Toggles the current input language such as switching between English and Japanese on // a QWERTY keyboard. On some devices, the same function may be performed by // pressing Shift+Spacebar. KCLanguageSwitch KeyCode = 204 // Manner Mode key. // Toggles silent or vibrate mode on and off to make the device behave more politely // in certain settings such as on a crowded train. On some devices, the key may only // operate when long-pressed. KCMannerMode KeyCode = 205 // 3D Mode key. // Toggles the display between 2D and 3D mode. KC3dMode KeyCode = 206 // Contacts special function key. // Used to launch an address book application. KCContacts KeyCode = 207 // Calendar special function key. // Used to launch a calendar application. KCCalendar KeyCode = 208 // Music special function key. // Used to launch a music player application. KCMusic KeyCode = 209 // Calculator special function key. // Used to launch a calculator application. KCCalculator KeyCode = 210 // Japanese full-width / half-width key. KCZenkakuHankaku KeyCode = 211 // Japanese alphanumeric key. KCEisu KeyCode = 212 // Japanese non-conversion key. KCMuhenkan KeyCode = 213 // Japanese conversion key. KCHenkan KeyCode = 214 // Japanese katakana / hiragana key. KCKatakanaHiragana KeyCode = 215 // Japanese Yen key. KCYen KeyCode = 216 // Japanese Ro key. KCRo KeyCode = 217 // Japanese kana key. KCKana KeyCode = 218 // Assist key. // Launches the global assist activity. Not delivered to applications. KCAssist KeyCode = 219 // Brightness Down key. // Adjusts the screen brightness down. KCBrightnessDown KeyCode = 220 // Brightness Up key. // Adjusts the screen brightness up. KCBrightnessUp KeyCode = 221 // Audio Track key. // Switches the audio tracks. KCMediaAudioTrack KeyCode = 222 // Sleep key. // Puts the device to sleep. Behaves somewhat like {@link #KEYCODE_POWER} but it // has no effect if the device is already asleep. KCSleep KeyCode = 223 // Wakeup key. // Wakes up the device. Behaves somewhat like {@link #KEYCODE_POWER} but it // has no effect if the device is already awake. KCWakeup KeyCode = 224 // Pairing key. // Initiates peripheral pairing mode. Useful for pairing remote control // devices or game controllers, especially if no other input mode is // available. KCPairing KeyCode = 225 // Media Top Menu key. // Goes to the top of media menu. KCMediaTopMenu KeyCode = 226 // '11' key. KC11 KeyCode = 227 // '12' key. KC12 KeyCode = 228 // Last Channel key. // Goes to the last viewed channel. KCLastChannel KeyCode = 229 // TV data service key. // Displays data services like weather, sports. KCTvDataService KeyCode = 230 // Voice Assist key. // Launches the global voice assist activity. Not delivered to applications. KCVoiceAssist KeyCode = 231 // Radio key. // Toggles TV service / Radio service. KCTvRadioService KeyCode = 232 // Teletext key. // Displays Teletext service. KCTvTeletext KeyCode = 233 // Number entry key. // Initiates to enter multi-digit channel nubmber when each digit key is assigned // for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC // User Control Code. KCTvNumberEntry KeyCode = 234 // Analog Terrestrial key. // Switches to analog terrestrial broadcast service. KCTvTerrestrialAnalog KeyCode = 235 // Digital Terrestrial key. // Switches to digital terrestrial broadcast service. KCTvTerrestrialDigital KeyCode = 236 // Satellite key. // Switches to digital satellite broadcast service. KCTvSatellite KeyCode = 237 // BS key. // Switches to BS digital satellite broadcasting service available in Japan. KCTvSatelliteBs KeyCode = 238 // CS key. // Switches to CS digital satellite broadcasting service available in Japan. KCTvSatelliteCs KeyCode = 239 // BS/CS key. // Toggles between BS and CS digital satellite services. KCTvSatelliteService KeyCode = 240 // Toggle Network key. // Toggles selecting broacast services. KCTvNetwork KeyCode = 241 // Antenna/Cable key. // Toggles broadcast input source between antenna and cable. KCTvAntennaCable KeyCode = 242 // HDMI #1 key. // Switches to HDMI input #1. KCTvInputHdmi1 KeyCode = 243 // HDMI #2 key. // Switches to HDMI input #2. KCTvInputHdmi2 KeyCode = 244 // HDMI #3 key. // Switches to HDMI input #3. KCTvInputHdmi3 KeyCode = 245 // HDMI #4 key. // Switches to HDMI input #4. KCTvInputHdmi4 KeyCode = 246 // Composite #1 key. // Switches to composite video input #1. KCTvInputComposite1 KeyCode = 247 // Composite #2 key. // Switches to composite video input #2. KCTvInputComposite2 KeyCode = 248 // Component #1 key. // Switches to component video input #1. KCTvInputComponent1 KeyCode = 249 // Component #2 key. // Switches to component video input #2. KCTvInputComponent2 KeyCode = 250 // VGA #1 key. // Switches to VGA (analog RGB) input #1. KCTvInputVga1 KeyCode = 251 // Audio description key. // Toggles audio description off / on. KCTvAudioDescription KeyCode = 252 // Audio description mixing volume up key. // Louden audio description volume as compared with normal audio volume. KCTvAudioDescriptionMixUp KeyCode = 253 // Audio description mixing volume down key. // Lessen audio description volume as compared with normal audio volume. KCTvAudioDescriptionMixDown KeyCode = 254 // Zoom mode key. // Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) KCTvZoomMode KeyCode = 255 // Contents menu key. // Goes to the title list. Corresponds to Contents Menu (0x0B) of CEC User Control // Code KCTvContentsMenu KeyCode = 256 // Media context menu key. // Goes to the context menu of media contents. Corresponds to Media Context-sensitive // Menu (0x11) of CEC User Control Code. KCTvMediaContextMenu KeyCode = 257 // Timer programming key. // Goes to the timer recording menu. Corresponds to Timer Programming (0x54) of // CEC User Control Code. KCTvTimerProgramming KeyCode = 258 // Help key. KCHelp KeyCode = 259 // Goes backward by one item in an ordered collection of items. KCNavigatePrevious KeyCode = 260 // Advances to the next item in an ordered collection of items. KCNavigateNext KeyCode = 261 // Activates the item that currently has focus or expands to the next level of a navigation // hierarchy. KCNavigateIn KeyCode = 262 // Backs out one level of a navigation hierarchy or collapses the item that currently has // focus. KCNavigateOut KeyCode = 263 // Primary stem key for Wear // Main power/reset button on watch. KCStemPrimary KeyCode = 264 // Generic stem key 1 for Wear KCStem1 KeyCode = 265 // Generic stem key 2 for Wear KCStem2 KeyCode = 266 // Generic stem key 3 for Wear KCStem3 KeyCode = 267 // Directional Pad Up-Left KCDPadUpLeft KeyCode = 268 // Directional Pad Down-Left KCDPadDownLeft KeyCode = 269 // Directional Pad Up-Right KCDPadUpRight KeyCode = 270 // Directional Pad Down-Right KCDPadDownRight KeyCode = 271 // Skip forward media key. KCMediaSkipForward KeyCode = 272 // Skip backward media key. KCMediaSkipBackward KeyCode = 273 // Step forward media key. // Steps media forward, one frame at a time. KCMediaStepForward KeyCode = 274 // Step backward media key. // Steps media backward, one frame at a time. KCMediaStepBackward KeyCode = 275 // put device to sleep unless a wakelock is held. KCSoftSleep KeyCode = 276 // Cut key. KCCut KeyCode = 277 // Copy key. KCCopy KeyCode = 278 // Paste key. KCPaste KeyCode = 279 KCSystemNavigationUp KeyCode = 280 KCSystemNavigationDown KeyCode = 281 KCSystemNavigationLeft KeyCode = 282 KCSystemNavigationRight KeyCode = 283 // Show all apps KCAllApps KeyCode = 284 // Refresh key. KCRefresh KeyCode = 285 )
type KeyFlag ¶
type KeyFlag int
const ( // KFWokeHere This mask is set if the device woke because of this key event. // Deprecated KFWokeHere KeyFlag = 0x1 // KFSoftKeyboard This mask is set if the key event was generated by a software keyboard. KFSoftKeyboard KeyFlag = 0x2 // KFKeepTouchMode This mask is set if we don't want the key event to cause us to leave touch mode. KFKeepTouchMode KeyFlag = 0x4 // KFFromSystem This mask is set if an event was known to come from a trusted part // of the system. That is, the event is known to come from the user, // and could not have been spoofed by a third party component. KFFromSystem KeyFlag = 0x8 // KFEditorAction This mask is used for compatibility, to identify enter keys that are // coming from an IME whose enter key has been auto-labelled "next" or // "done". This allows TextView to dispatch these as normal enter keys // for old applications, but still do the appropriate action when receiving them. KFEditorAction KeyFlag = 0x10 // KFCanceled When associated with up key events, this indicates that the key press // has been canceled. Typically this is used with virtual touch screen // keys, where the user can slide from the virtual key area on to the // display: in that case, the application will receive a canceled up // event and should not perform the action normally associated with the // key. Note that for this to work, the application can not perform an // action for a key until it receives an up or the long press timeout has expired. KFCanceled KeyFlag = 0x20 // KFVirtualHardKey This key event was generated by a virtual (on-screen) hard key area. // Typically this is an area of the touchscreen, outside of the regular // display, dedicated to "hardware" buttons. KFVirtualHardKey KeyFlag = 0x40 // KFLongPress This flag is set for the first key repeat that occurs after the long press timeout. KFLongPress KeyFlag = 0x80 // KFCanceledLongPress Set when a key event has `KFCanceled` set because a long // press action was executed while it was down. KFCanceledLongPress KeyFlag = 0x100 // KFTracking Set for `ACTION_UP` when this event's key code is still being // tracked from its initial down. That is, somebody requested that tracking // started on the key down and a long press has not caused // the tracking to be canceled. KFTracking KeyFlag = 0x200 // KFFallback Set when a key event has been synthesized to implement default behavior // for an event that the application did not handle. // Fallback key events are generated by unhandled trackball motions // (to emulate a directional keypad) and by certain unhandled key presses // that are declared in the key map (such as special function numeric keypad // keys when numlock is off). KFFallback KeyFlag = 0x400 )
type MobileAction ¶
type MobileAction struct { Method MobileMethod `json:"method,omitempty" yaml:"method,omitempty"` Params interface{} `json:"params,omitempty" yaml:"params,omitempty"` Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"` // used to identify the action in log MaxRetryTimes int `json:"max_retry_times,omitempty" yaml:"max_retry_times,omitempty"` // max retry times WaitTime float64 `json:"wait_time,omitempty" yaml:"wait_time,omitempty"` // wait time between swipe and ocr, unit: second Direction interface{} `json:"direction,omitempty" yaml:"direction,omitempty"` // used by swipe to tap text or app Scope []float64 `json:"scope,omitempty" yaml:"scope,omitempty"` // used by ocr to get text position in the scope Offset []int `json:"offset,omitempty" yaml:"offset,omitempty"` // used to tap offset of point Index int `json:"index,omitempty" yaml:"index,omitempty"` // index of the target element, should start from 1 Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"` // TODO: wait timeout in seconds for mobile action IgnoreNotFoundError bool `json:"ignore_NotFoundError,omitempty" yaml:"ignore_NotFoundError,omitempty"` // ignore error if target element not found Text string `json:"text,omitempty" yaml:"text,omitempty"` ID string `json:"id,omitempty" yaml:"id,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` }
type MobileMethod ¶
type MobileMethod string
type NotificationType ¶
type NotificationType string
const ( NotificationTypePlain NotificationType = "plain" NotificationTypeDarwin NotificationType = "darwin" )
type OCRService ¶
type Orientation ¶
type Orientation string
const ( // OrientationPortrait Device oriented vertically, home button on the bottom OrientationPortrait Orientation = "PORTRAIT" // OrientationPortraitUpsideDown Device oriented vertically, home button on the top OrientationPortraitUpsideDown Orientation = "UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN" // OrientationLandscapeLeft Device oriented horizontally, home button on the right OrientationLandscapeLeft Orientation = "LANDSCAPE" // OrientationLandscapeRight Device oriented horizontally, home button on the left OrientationLandscapeRight Orientation = "UIA_DEVICE_ORIENTATION_LANDSCAPERIGHT" )
type PasteboardType ¶
type PasteboardType string
PasteboardType The type of the item on the pasteboard.
const ( PasteboardTypePlaintext PasteboardType = "plaintext" PasteboardTypeImage PasteboardType = "image" PasteboardTypeUrl PasteboardType = "url" )
type PickerWheelOrder ¶
type PickerWheelOrder string
const ( PickerWheelOrderNext PickerWheelOrder = "next" PickerWheelOrderPrevious PickerWheelOrder = "previous" )
type ProtectedResource ¶
type ProtectedResource int
ProtectedResource A system resource that requires user authorization to access.
const ( ProtectedResourceContacts ProtectedResource = 1 ProtectedResourceCalendar ProtectedResource = 2 ProtectedResourceReminders ProtectedResource = 3 ProtectedResourcePhotos ProtectedResource = 4 ProtectedResourceMicrophone ProtectedResource = 5 ProtectedResourceCamera ProtectedResource = 6 ProtectedResourceMediaLibrary ProtectedResource = 7 ProtectedResourceHomeKit ProtectedResource = 8 ProtectedResourceSystemRootDirectory ProtectedResource = 0x40000000 ProtectedResourceUserDesktopDirectory ProtectedResource = 0x40000001 ProtectedResourceUserDownloadsDirectory ProtectedResource = 0x40000002 ProtectedResourceUserDocumentsDirectory ProtectedResource = 0x40000003 ProtectedResourceBluetooth ProtectedResource = -0x40000000 ProtectedResourceKeyboardNetwork ProtectedResource = -0x40000001 ProtectedResourceLocation ProtectedResource = -0x40000002 ProtectedResourceHealth ProtectedResource = -0x40000003 )
https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc
type ResponseOCR ¶
type SessionInfo ¶
type SourceOption ¶
type SourceOption map[string]interface{}
SourceOption Configure the format or attribute of the Source
func NewSourceOption ¶
func NewSourceOption() SourceOption
func (SourceOption) WithExcludedAttributes ¶
func (opt SourceOption) WithExcludedAttributes(attributes []string) SourceOption
WithExcludedAttributes Excludes the given attribute names. only `xml` is supported.
func (SourceOption) WithFormatAsDescription ¶
func (opt SourceOption) WithFormatAsDescription() SourceOption
WithFormatAsDescription Application elements tree in form of internal XCTest debugDescription string
func (SourceOption) WithFormatAsJson ¶
func (opt SourceOption) WithFormatAsJson() SourceOption
WithFormatAsJson Application elements tree in form of json string
func (SourceOption) WithFormatAsXml ¶
func (opt SourceOption) WithFormatAsXml() SourceOption
WithFormatAsXml Application elements tree in form of xml string
func (SourceOption) WithScope ¶
func (opt SourceOption) WithScope(scope string) SourceOption
WithScope Allows to provide XML scope.
only `xml` is supported.
type TemplateMatchMode ¶
type TemplateMatchMode int
TemplateMatchMode is the type of the template matching operation.
type TouchAction ¶
type TouchAction []touchGesture
func NewTouchAction ¶
func NewTouchAction(cap ...int) *TouchAction
func (*TouchAction) Add ¶
func (ta *TouchAction) Add(x, y int, startTime ...float64) *TouchAction
func (*TouchAction) AddFloat ¶
func (ta *TouchAction) AddFloat(x, y float64, startTime ...float64) *TouchAction
func (*TouchAction) AddPoint ¶
func (ta *TouchAction) AddPoint(point Point, startTime ...float64) *TouchAction
func (*TouchAction) AddPointF ¶
func (ta *TouchAction) AddPointF(point PointF, startTime ...float64) *TouchAction
type TouchActionLongPress ¶
type TouchActionLongPress map[string]interface{}
func NewTouchActionLongPress ¶
func NewTouchActionLongPress() TouchActionLongPress
func (TouchActionLongPress) WithElement ¶
func (opt TouchActionLongPress) WithElement(element WebElement) TouchActionLongPress
func (TouchActionLongPress) WithXY ¶
func (opt TouchActionLongPress) WithXY(x, y int) TouchActionLongPress
func (TouchActionLongPress) WithXYFloat ¶
func (opt TouchActionLongPress) WithXYFloat(x, y float64) TouchActionLongPress
type TouchActionMoveTo ¶
type TouchActionMoveTo map[string]interface{}
func NewTouchActionMoveTo ¶
func NewTouchActionMoveTo() TouchActionMoveTo
func (TouchActionMoveTo) WithElement ¶
func (opt TouchActionMoveTo) WithElement(element WebElement) TouchActionMoveTo
func (TouchActionMoveTo) WithXY ¶
func (opt TouchActionMoveTo) WithXY(x, y int) TouchActionMoveTo
func (TouchActionMoveTo) WithXYFloat ¶
func (opt TouchActionMoveTo) WithXYFloat(x, y float64) TouchActionMoveTo
type TouchActionPress ¶
type TouchActionPress map[string]interface{}
func NewTouchActionPress ¶
func NewTouchActionPress() TouchActionPress
func (TouchActionPress) WithElement ¶
func (opt TouchActionPress) WithElement(element WebElement) TouchActionPress
func (TouchActionPress) WithPressure ¶
func (opt TouchActionPress) WithPressure(pressure float64) TouchActionPress
func (TouchActionPress) WithXY ¶
func (opt TouchActionPress) WithXY(x, y int) TouchActionPress
func (TouchActionPress) WithXYFloat ¶
func (opt TouchActionPress) WithXYFloat(x, y float64) TouchActionPress
type TouchActionTap ¶
type TouchActionTap map[string]interface{}
func NewTouchActionTap ¶
func NewTouchActionTap() TouchActionTap
func (TouchActionTap) WithCount ¶
func (opt TouchActionTap) WithCount(count int) TouchActionTap
func (TouchActionTap) WithElement ¶
func (opt TouchActionTap) WithElement(element WebElement) TouchActionTap
func (TouchActionTap) WithXY ¶
func (opt TouchActionTap) WithXY(x, y int) TouchActionTap
func (TouchActionTap) WithXYFloat ¶
func (opt TouchActionTap) WithXYFloat(x, y float64) TouchActionTap
type TouchActions ¶
type TouchActions []map[string]interface{}
func NewTouchActions ¶
func NewTouchActions(capacity ...int) *TouchActions
func (*TouchActions) Cancel ¶
func (act *TouchActions) Cancel() *TouchActions
func (*TouchActions) LongPress ¶
func (act *TouchActions) LongPress(opt TouchActionLongPress) *TouchActions
func (*TouchActions) MoveTo ¶
func (act *TouchActions) MoveTo(opt TouchActionMoveTo) *TouchActions
func (*TouchActions) Press ¶
func (act *TouchActions) Press(opt TouchActionPress) *TouchActions
func (*TouchActions) Release ¶
func (act *TouchActions) Release() *TouchActions
func (*TouchActions) Tap ¶
func (act *TouchActions) Tap(opt TouchActionTap) *TouchActions
func (*TouchActions) Wait ¶
func (act *TouchActions) Wait(second ...float64) *TouchActions
type UiSelectorHelper ¶
type UiSelectorHelper struct {
// contains filtered or unexported fields
}
func NewUiSelectorHelper ¶
func NewUiSelectorHelper() UiSelectorHelper
func (UiSelectorHelper) Checkable ¶
func (s UiSelectorHelper) Checkable(b bool) UiSelectorHelper
Checkable Set the search criteria to match widgets that are checkable.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) Checked ¶
func (s UiSelectorHelper) Checked(b bool) UiSelectorHelper
Checked Set the search criteria to match widgets that are currently checked (usually for checkboxes).
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) ChildSelector ¶
func (s UiSelectorHelper) ChildSelector(selector UiSelectorHelper) UiSelectorHelper
ChildSelector Adds a child UiSelector criteria to this selector.
Use this selector to narrow the search scope to child widgets under a specific parent widget.
func (UiSelectorHelper) ClassName ¶
func (s UiSelectorHelper) ClassName(className string) UiSelectorHelper
ClassName Set the search criteria to match the class property for a widget (for example, "android.widget.Button").
func (UiSelectorHelper) ClassNameMatches ¶
func (s UiSelectorHelper) ClassNameMatches(regex string) UiSelectorHelper
ClassNameMatches Set the search criteria to match the class property for a widget, using a regular expression.
func (UiSelectorHelper) Clickable ¶
func (s UiSelectorHelper) Clickable(b bool) UiSelectorHelper
Clickable Set the search criteria to match widgets that are clickable.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) ContainerSelector ¶
func (s UiSelectorHelper) ContainerSelector(selector UiSelectorHelper) UiSelectorHelper
func (UiSelectorHelper) Description ¶
func (s UiSelectorHelper) Description(desc string) UiSelectorHelper
Description Set the search criteria to match the content-description property for a widget.
The content-description is typically used by the Android Accessibility framework to provide an audio prompt for the widget when the widget is selected. The content-description for the widget must match exactly with the string in your input argument.
Matching is case-sensitive.
func (UiSelectorHelper) DescriptionContains ¶
func (s UiSelectorHelper) DescriptionContains(desc string) UiSelectorHelper
DescriptionContains Set the search criteria to match the content-description property for a widget.
The content-description is typically used by the Android Accessibility framework to provide an audio prompt for the widget when the widget is selected. The content-description for the widget must contain the string in your input argument.
Matching is case-insensitive.
func (UiSelectorHelper) DescriptionMatches ¶
func (s UiSelectorHelper) DescriptionMatches(regex string) UiSelectorHelper
DescriptionMatches Set the search criteria to match the content-description property for a widget.
The content-description is typically used by the Android Accessibility framework to provide an audio prompt for the widget when the widget is selected. The content-description for the widget must match exactly with the string in your input argument.
func (UiSelectorHelper) DescriptionStartsWith ¶
func (s UiSelectorHelper) DescriptionStartsWith(desc string) UiSelectorHelper
DescriptionStartsWith Set the search criteria to match the content-description property for a widget.
The content-description is typically used by the Android Accessibility framework to provide an audio prompt for the widget when the widget is selected. The content-description for the widget must start with the string in your input argument.
Matching is case-insensitive.
func (UiSelectorHelper) Enabled ¶
func (s UiSelectorHelper) Enabled(b bool) UiSelectorHelper
Enabled Set the search criteria to match widgets that are enabled.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) Focusable ¶
func (s UiSelectorHelper) Focusable(b bool) UiSelectorHelper
Focusable Set the search criteria to match widgets that are focusable.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) Focused ¶
func (s UiSelectorHelper) Focused(b bool) UiSelectorHelper
Focused Set the search criteria to match widgets that have focus.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) FromParent ¶
func (s UiSelectorHelper) FromParent(selector UiSelectorHelper) UiSelectorHelper
FromParent Adds a child UiSelector criteria to this selector which is used to start search from the parent widget.
Use this selector to narrow the search scope to sibling widgets as well all child widgets under a parent.
func (UiSelectorHelper) Index ¶
func (s UiSelectorHelper) Index(index int) UiSelectorHelper
Index Set the search criteria to match the widget by its node index in the layout hierarchy.
The index value must be 0 or greater.
Using the index can be unreliable and should only be used as a last resort for matching. Instead, consider using the `Instance(int)` method.
func (UiSelectorHelper) Instance ¶
func (s UiSelectorHelper) Instance(instance int) UiSelectorHelper
Instance Set the search criteria to match the widget by its instance number.
The instance value must be 0 or greater, where the first instance is 0.
For example, to simulate a user click on the third image that is enabled in a UI screen, you could specify a a search criteria where the instance is 2, the `className(String)` matches the image widget class, and `enabled(boolean)` is true. The code would look like this:
`new UiSelector().className("android.widget.ImageView") .enabled(true).instance(2);`
func (UiSelectorHelper) LongClickable ¶
func (s UiSelectorHelper) LongClickable(b bool) UiSelectorHelper
LongClickable Set the search criteria to match widgets that are long-clickable.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) PackageNameMatches ¶
func (s UiSelectorHelper) PackageNameMatches(regex string) UiSelectorHelper
PackageNameMatches Set the search criteria to match the package name of the application that contains the widget.
func (UiSelectorHelper) PatternSelector ¶
func (s UiSelectorHelper) PatternSelector(selector UiSelectorHelper) UiSelectorHelper
func (UiSelectorHelper) ResourceId ¶
func (s UiSelectorHelper) ResourceId(id string) UiSelectorHelper
ResourceId Set the search criteria to match the given resource ID.
func (UiSelectorHelper) ResourceIdMatches ¶
func (s UiSelectorHelper) ResourceIdMatches(regex string) UiSelectorHelper
ResourceIdMatches Set the search criteria to match the resource ID of the widget, using a regular expression.
func (UiSelectorHelper) Scrollable ¶
func (s UiSelectorHelper) Scrollable(b bool) UiSelectorHelper
Scrollable Set the search criteria to match widgets that are scrollable.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) Selected ¶
func (s UiSelectorHelper) Selected(b bool) UiSelectorHelper
Selected Set the search criteria to match widgets that are currently selected.
Typically, using this search criteria alone is not useful. You should also include additional criteria, such as text, content-description, or the class name for a widget.
If no other search criteria is specified, and there is more than one matching widget, the first widget in the tree is selected.
func (UiSelectorHelper) String ¶
func (s UiSelectorHelper) String() string
func (UiSelectorHelper) Text ¶
func (s UiSelectorHelper) Text(text string) UiSelectorHelper
Text Set the search criteria to match the visible text displayed in a widget (for example, the text label to launch an app).
The text for the element must match exactly with the string in your input argument. Matching is case-sensitive.
func (UiSelectorHelper) TextContains ¶
func (s UiSelectorHelper) TextContains(text string) UiSelectorHelper
TextContains Set the search criteria to match the visible text in a widget where the visible text must contain the string in your input argument.
The matching is case-sensitive.
func (UiSelectorHelper) TextMatches ¶
func (s UiSelectorHelper) TextMatches(regex string) UiSelectorHelper
TextMatches Set the search criteria to match the visible text displayed in a layout element, using a regular expression.
The text in the widget must match exactly with the string in your input argument.
func (UiSelectorHelper) TextStartsWith ¶
func (s UiSelectorHelper) TextStartsWith(text string) UiSelectorHelper
TextStartsWith Set the search criteria to match visible text in a widget that is prefixed by the text parameter.
The matching is case-insensitive.
type W3CActions ¶
type W3CActions []map[string]interface{}
func NewW3CActions ¶
func NewW3CActions(capacity ...int) *W3CActions
func (*W3CActions) DoubleTap ¶
func (act *W3CActions) DoubleTap(x, y int, element ...WebElement) *W3CActions
func (*W3CActions) FingerAction ¶
func (act *W3CActions) FingerAction(fingerAct *FingerAction, fActs ...*FingerAction) *W3CActions
func (*W3CActions) Press ¶
func (act *W3CActions) Press(x, y int, second float64, element ...WebElement) *W3CActions
func (*W3CActions) SendKeys ¶
func (act *W3CActions) SendKeys(text string) *W3CActions
func (*W3CActions) Swipe ¶
func (act *W3CActions) Swipe(fromX, fromY, toX, toY int, element ...WebElement) *W3CActions
func (*W3CActions) SwipeFloat ¶
func (act *W3CActions) SwipeFloat(fromX, fromY, toX, toY float64, element ...WebElement) *W3CActions
func (*W3CActions) Tap ¶
func (act *W3CActions) Tap(x, y int, element ...WebElement) *W3CActions
type W3CGestures ¶
type W3CGestures []w3cGesture
func NewW3CGestures ¶
func NewW3CGestures(cap ...int) *W3CGestures
func (*W3CGestures) KeyDown ¶
func (g *W3CGestures) KeyDown(value string) *W3CGestures
func (*W3CGestures) KeyUp ¶
func (g *W3CGestures) KeyUp(value string) *W3CGestures
func (*W3CGestures) Pause ¶
func (g *W3CGestures) Pause(duration ...float64) *W3CGestures
func (*W3CGestures) SendKeys ¶
func (g *W3CGestures) SendKeys(text string) *W3CGestures
type WebDriver ¶
type WebDriver interface { // NewSession starts a new session and returns the SessionInfo. NewSession(capabilities Capabilities) (SessionInfo, error) ActiveSession() (SessionInfo, error) // DeleteSession Kills application associated with that session and removes session // 1) alertsMonitor disable // 2) testedApplicationBundleId terminate DeleteSession() error Status() (DeviceStatus, error) DeviceInfo() (DeviceInfo, error) // Location Returns device location data. // // It requires to configure location access permission by manual. // The response of 'latitude', 'longitude' and 'altitude' are always zero (0) without authorization. // 'authorizationStatus' indicates current authorization status. '3' is 'Always'. // https://developer.apple.com/documentation/corelocation/clauthorizationstatus // // Settings -> Privacy -> Location Service -> WebDriverAgent-Runner -> Always // // The return value could be zero even if the permission is set to 'Always' // since the location service needs some time to update the location data. Location() (Location, error) BatteryInfo() (BatteryInfo, error) WindowSize() (Size, error) Screen() (Screen, error) Scale() (float64, error) ActiveAppInfo() (AppInfo, error) // ActiveAppsList Retrieves the information about the currently active apps ActiveAppsList() ([]AppBaseInfo, error) // AppState Get the state of the particular application in scope of the current session. // !This method is only returning reliable results since Xcode9 SDK AppState(bundleId string) (AppState, error) // IsLocked Checks if the screen is locked or not. IsLocked() (bool, error) // Unlock Forces the device under test to unlock. // An immediate return will happen if the device is already unlocked // and an error is going to be thrown if the screen has not been unlocked after the timeout. Unlock() error // Lock Forces the device under test to switch to the lock screen. // An immediate return will happen if the device is already locked // and an error is going to be thrown if the screen has not been locked after the timeout. Lock() error // Homescreen Forces the device under test to switch to the home screen Homescreen() error // AlertText Returns alert's title and description separated by new lines AlertText() (string, error) // AlertButtons Gets the labels of the buttons visible in the alert AlertButtons() ([]string, error) // AlertAccept Accepts alert, if present AlertAccept(label ...string) error // AlertDismiss Dismisses alert, if present AlertDismiss(label ...string) error // AlertSendKeys Types a text into an input inside the alert container, if it is present AlertSendKeys(text string) error // AppLaunch Launch an application with given bundle identifier in scope of current session. // !This method is only available since Xcode9 SDK AppLaunch(bundleId string, launchOpt ...AppLaunchOption) error // AppLaunchUnattached Launch the app with the specified bundle ID. AppLaunchUnattached(bundleId string) error // AppTerminate Terminate an application with the given bundle id. // Either `true` if the app has been successfully terminated or `false` if it was not running AppTerminate(bundleId string) (bool, error) // AppActivate Activate an application with given bundle identifier in scope of current session. // !This method is only available since Xcode9 SDK AppActivate(bundleId string) error // AppDeactivate Deactivates application for given time and then activate it again // The minimum application switch wait is 3 seconds AppDeactivate(second float64) error // AppAuthReset Resets the authorization status for a protected resource. Available since Xcode 11.4 AppAuthReset(ProtectedResource) error // StartCamera Starts a new camera for recording StartCamera() error // StopCamera Stops the camera for recording StopCamera() error // Tap Sends a tap event at the coordinate. Tap(x, y int, options ...DataOption) error TapFloat(x, y float64, options ...DataOption) error // DoubleTap Sends a double tap event at the coordinate. DoubleTap(x, y int) error DoubleTapFloat(x, y float64) error // TouchAndHold Initiates a long-press gesture at the coordinate, holding for the specified duration. // second: The default value is 1 TouchAndHold(x, y int, second ...float64) error TouchAndHoldFloat(x, y float64, second ...float64) error // Drag Initiates a press-and-hold gesture at the coordinate, then drags to another coordinate. // WithPressDurationOption option can be used to set pressForDuration (default to 1 second). Drag(fromX, fromY, toX, toY int, options ...DataOption) error DragFloat(fromX, fromY, toX, toY float64, options ...DataOption) error // Swipe works like Drag, but `pressForDuration` value is 0 Swipe(fromX, fromY, toX, toY int, options ...DataOption) error SwipeFloat(fromX, fromY, toX, toY float64, options ...DataOption) error ForceTouch(x, y int, pressure float64, second ...float64) error ForceTouchFloat(x, y, pressure float64, second ...float64) error // PerformW3CActions Perform complex touch action in scope of the current application. PerformW3CActions(actions *W3CActions) error PerformAppiumTouchActions(touchActs *TouchActions) error // SetPasteboard Sets data to the general pasteboard SetPasteboard(contentType PasteboardType, content string) error // GetPasteboard Gets the data contained in the general pasteboard. // It worked when `WDA` was foreground. https://github.com/appium/WebDriverAgent/issues/330 GetPasteboard(contentType PasteboardType) (raw *bytes.Buffer, err error) // SendKeys Types a string into active element. There must be element with keyboard focus, // otherwise an error is raised. // WithFrequency option can be used to set frequency of typing (letters per sec). The default value is 60 SendKeys(text string, options ...DataOption) error // Input works like SendKeys Input(text string, options ...DataOption) error // KeyboardDismiss Tries to dismiss the on-screen keyboard KeyboardDismiss(keyNames ...string) error // PressButton Presses the corresponding hardware button on the device PressButton(devBtn DeviceButton) error // IOHIDEvent Emulated triggering of the given low-level IOHID device event. // duration: The event duration in float seconds (XCTest uses 0.005 for a single press event) IOHIDEvent(pageID EventPageID, usageID EventUsageID, duration ...float64) error // ExpectNotification Creates an expectation that is fulfilled when an expected Notification is received ExpectNotification(notifyName string, notifyType NotificationType, second ...int) error // SiriActivate Activates Siri service voice recognition with the given text to parse SiriActivate(text string) error // SiriOpenUrl Opens the particular url scheme using Siri voice recognition helpers. // !This will only work since XCode 8.3/iOS 10.3 // It doesn't actually work, right? SiriOpenUrl(url string) error Orientation() (Orientation, error) // SetOrientation Sets requested device interface orientation. SetOrientation(Orientation) error Rotation() (Rotation, error) // SetRotation Sets the devices orientation to the rotation passed. SetRotation(Rotation) error // MatchTouchID Matches or mismatches TouchID request MatchTouchID(isMatch bool) error // ActiveElement Returns the element, which currently holds the keyboard input focus or nil if there are no such elements. ActiveElement() (WebElement, error) FindElement(by BySelector) (WebElement, error) FindElements(by BySelector) ([]WebElement, error) Screenshot() (*bytes.Buffer, error) // Source Return application elements tree Source(srcOpt ...SourceOption) (string, error) // AccessibleSource Return application elements accessibility tree AccessibleSource() (string, error) // HealthCheck Health check might modify simulator state so it should only be called in-between testing sessions // Checks health of XCTest by: // 1) Querying application for some elements, // 2) Triggering some device events. HealthCheck() error GetAppiumSettings() (map[string]interface{}, error) SetAppiumSettings(settings map[string]interface{}) (map[string]interface{}, error) IsHealthy() (bool, error) // WaitWithTimeoutAndInterval waits for the condition to evaluate to true. WaitWithTimeoutAndInterval(condition Condition, timeout, interval time.Duration) error // WaitWithTimeout works like WaitWithTimeoutAndInterval, but with default polling interval. WaitWithTimeout(condition Condition, timeout time.Duration) error // Wait works like WaitWithTimeoutAndInterval, but using the default timeout and polling interval. Wait(condition Condition) error // Close inner connections properly Close() error // triggers the log capture and returns the log entries StartCaptureLog(identifier ...string) (err error) StopCaptureLog() (result interface{}, err error) }
WebDriver defines methods supported by WebDriver drivers.
type WebElement ¶
type WebElement interface { // Click Waits for element to become stable (not move) and performs sync tap on element. Click() error // SendKeys Types a text into element. It will try to activate keyboard on element, // if element has no keyboard focus. // frequency: Frequency of typing (letters per sec). The default value is 60 SendKeys(text string, options ...DataOption) error // Clear Clears text on element. It will try to activate keyboard on element, // if element has no keyboard focus. Clear() error // Tap Waits for element to become stable (not move) and performs sync tap on element, // relative to the current element position Tap(x, y int) error TapFloat(x, y float64) error // DoubleTap Sends a double tap event to a hittable point computed for the element. DoubleTap() error // TouchAndHold Sends a long-press gesture to a hittable point computed for the element, // holding for the specified duration. // second: The default value is 1 TouchAndHold(second ...float64) error // TwoFingerTap Sends a two finger tap event to a hittable point computed for the element. TwoFingerTap() error // TapWithNumberOfTaps Sends one or more taps with one or more touch points. TapWithNumberOfTaps(numberOfTaps, numberOfTouches int) error // ForceTouch Waits for element to become stable (not move) and performs sync force touch on element. // second: The default value is 1 ForceTouch(pressure float64, second ...float64) error // ForceTouchFloat works like ForceTouch, but relative to the current element position ForceTouchFloat(x, y, pressure float64, second ...float64) error // Drag Initiates a press-and-hold gesture at the coordinate, then drags to another coordinate. // relative to the current element position // pressForDuration: The default value is 1 second. Drag(fromX, fromY, toX, toY int, pressForDuration ...float64) error DragFloat(fromX, fromY, toX, toY float64, pressForDuration ...float64) error // Swipe works like Drag, but `pressForDuration` value is 0. // relative to the current element position Swipe(fromX, fromY, toX, toY int) error SwipeFloat(fromX, fromY, toX, toY float64) error // SwipeDirection Performs swipe gesture on the element. // velocity: swipe speed in pixels per second. Custom velocity values are only supported since Xcode SDK 11.4. SwipeDirection(direction Direction, velocity ...float64) error // Pinch Sends a pinching gesture with two touches. // scale: The scale of the pinch gesture. Use a scale between 0 and 1 to "pinch close" or zoom out // and a scale greater than 1 to "pinch open" or zoom in. // velocity: The velocity of the pinch in scale factor per second. Pinch(scale, velocity float64) error PinchToZoomOutByW3CAction(scale ...float64) error // Rotate Sends a rotation gesture with two touches. // rotation: The rotation of the gesture in radians. // velocity: The velocity of the rotation gesture in radians per second. Rotate(rotation float64, velocity ...float64) error // PickerWheelSelect // offset: The default value is 2 PickerWheelSelect(order PickerWheelOrder, offset ...int) error ScrollElementByName(name string) error ScrollElementByPredicate(predicate string) error ScrollToVisible() error // ScrollDirection // distance: The default value is 0.5 ScrollDirection(direction Direction, distance ...float64) error FindElement(by BySelector) (element WebElement, err error) FindElements(by BySelector) (elements []WebElement, err error) FindVisibleCells() (elements []WebElement, err error) Rect() (rect Rect, err error) Location() (Point, error) Size() (Size, error) Text() (text string, err error) Type() (elemType string, err error) IsEnabled() (enabled bool, err error) IsDisplayed() (displayed bool, err error) IsSelected() (selected bool, err error) IsAccessible() (accessible bool, err error) IsAccessibilityContainer() (isAccessibilityContainer bool, err error) GetAttribute(attr ElementAttribute) (value string, err error) UID() (uid string) Screenshot() (raw *bytes.Buffer, err error) }
WebElement defines method supported by web elements.