driver

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Delivered    = "delivered"
	NotDelivered = "notDelivered"
	Unknown      = "unknown"
)

Variables

View Source
var ErrNoSuchKey = errors.New("no such key")
View Source
var ErrTypingVerificationUnavailable = errors.New("focused field verification unavailable")

Functions

func NoSuchKey added in v0.6.0

func NoSuchKey(msg string) error

Types

type ActionOpts

type ActionOpts struct {
	Target     *ActionTarget
	Watch      *ui.Rect
	Aim        *Aim
	NoSettle   bool
	React      bool
	Hold       time.Duration
	Drag       bool
	Rest       bool
	InRepeat   bool
	NoChangeMs int
	Timeout    time.Duration
}

type ActionResult

type ActionResult struct {
	Probed           bool
	Targeted         bool
	Withheld         string
	WithheldWhy      string
	LiveFrame        *ui.Rect
	Cancelled        bool
	Touch            string
	Guarded          bool
	ChangedSinceRead bool
	Settle           SettleResult
	InjectMs         int
	SettleMs         int
	Seq              int64
	AimAt            *ui.Rect
	Clicked          *bool
	ClicksBefore     *int64
	NotInjected      string
	PressCut         *PressCut
	WindowWait       time.Duration
	FirstInWindow    bool
	WindowAge        time.Duration
	WindowOver       bool
	AppEntering      bool
	Unconfirmed      bool
	DeliveryToken    int64
	Reached          bool
	Typing           string
}

type ActionTarget added in v0.4.0

type ActionTarget struct {
	Seq    int64
	ID     string
	Window int
	Bounds ui.Rect
	Moving bool
}

type Aim added in v0.6.0

type Aim struct {
	Read   int64
	Window int
	Ref    int
}

type CheckedTextTyper added in v0.4.0

type CheckedTextTyper interface {
	TypeTextChecked(context.Context, string, ActionOpts) (ActionResult, error)
}

type ClickCounter added in v0.4.0

type ClickCounter interface {
	Clicks(ctx context.Context) (int64, error)
}

type DeliveryChecker added in v0.6.0

type DeliveryChecker interface {
	Delivery(ctx context.Context, token int64, wait time.Duration) (DeliveryVerdict, error)
}

type DeliveryVerdict added in v0.6.0

type DeliveryVerdict struct {
	Verdict  string
	ReportMs *int
	AnswerMs []int
	Pending  bool
	Implicit bool
}

type Dialog added in v0.5.3

type Dialog struct {
	Type       string
	Message    string
	Default    string
	URL        string
	Answer     string
	Background bool
	Note       string
}

type DialogAnswer added in v0.5.3

type DialogAnswer struct {
	Cancel  bool
	Text    string
	HasText bool
}

type DialogAnswerer added in v0.5.3

type DialogAnswerer interface {
	AnswerDialogs(ctx context.Context, a DialogAnswer) error
}

type DialogLog added in v0.5.3

type DialogLog interface {
	Dialogs(since int) ([]Dialog, int)
}

type Driver

type Driver interface {
	Platform() string
	Serial() string
	Name() string
	Size() (w, h int)

	Screen(ctx context.Context) (*ui.Screen, error)
	Seq() int64
	Events() (<-chan Event, func())
	WaitSettled(ctx context.Context, timeout time.Duration) error
	Settle(ctx context.Context, since int64, noChangeMs int, timeout time.Duration) (SettleResult, error)

	Tap(ctx context.Context, x, y int, o ActionOpts) (ActionResult, error)
	DoubleTap(ctx context.Context, x, y int, o ActionOpts) (ActionResult, error)
	LongPress(ctx context.Context, x, y int, hold time.Duration, o ActionOpts) (ActionResult, error)
	Swipe(ctx context.Context, x1, y1, x2, y2 int, dur time.Duration, o ActionOpts) (ActionResult, error)
	TypeText(ctx context.Context, text string, o ActionOpts) (ActionResult, error)
	EraseText(ctx context.Context, n int, o ActionOpts) (ActionResult, error)
	PressKey(ctx context.Context, key string, o ActionOpts) (ActionResult, error)
	HideKeyboard(ctx context.Context) error

	Screenshot(ctx context.Context, scale float64, format string) ([]byte, error)

	LaunchApp(ctx context.Context, appID string, o LaunchOpts) error
	StopApp(ctx context.Context, appID string) error
	KillApp(ctx context.Context, appID string) error
	ClearState(ctx context.Context, appID string) error
	ClearKeychain(ctx context.Context) error
	OpenLink(ctx context.Context, link, appID string, autoVerify, browser bool) error
	SetPermissions(ctx context.Context, appID string, perms map[string]string) error
	SetLocation(ctx context.Context, lat, lon float64) error
	SetOrientation(ctx context.Context, orientation string) error
	SetAirplaneMode(ctx context.Context, on bool) error
	ToggleAirplaneMode(ctx context.Context) error
	AddMedia(ctx context.Context, paths []string) error
	InstallApp(ctx context.Context, path string) error
	Foreground(ctx context.Context) (string, error)
	WaitForApp(ctx context.Context, appID string, timeout time.Duration) error

	StartRecording(ctx context.Context, path string) error
	StopRecording(ctx context.Context) error

	Close() error
}

type Event

type Event struct {
	Kind string
	Seq  int64
	Pkg  string
}

type ExactRecordingClock added in v0.6.1

type ExactRecordingClock interface {
	RecordingClockExact() bool
}

type Keeper added in v0.3.0

type Keeper interface {
	Keep(ctx context.Context) error
}

type Killer added in v0.5.3

type Killer interface {
	Kill()
}

type LaunchOpts

type LaunchOpts struct {
	ClearState    bool
	ClearKeychain bool
	StopApp       bool
	Permissions   map[string]string
	Arguments     map[string]any
}

type LostChecker added in v0.5.3

type LostChecker interface {
	Lost() error
}

type MountedCoverWaiter added in v0.4.0

type MountedCoverWaiter interface {
	AwaitCoverGone(ctx context.Context, window int, pkg, id, class string, x, y int, timeout time.Duration) (observed, gone bool, err error)
}

type NetworkMock added in v0.5.3

type NetworkMock struct {
	URL     string
	Method  string
	Status  int
	Headers [][2]string
	Body    []byte
	Delay   time.Duration
	Fail    bool
}

type NetworkMocker added in v0.5.3

type NetworkMocker interface {
	MockNetwork(ctx context.Context, m NetworkMock) error
	ClearNetworkMocks(ctx context.Context) error
}

type Noter added in v0.5.3

type Noter interface {
	Notes() []string
}

type PressCut added in v0.6.0

type PressCut struct{ SeenMs, PressMs, StallMs int }

type RecordingClock added in v0.6.0

type RecordingClock interface {
	RecordingStarted() time.Time
}

type RecordingMark added in v0.6.2

type RecordingMark interface {
	RecordingMark() (shown time.Time, held time.Duration, ok bool)
}

type RecordingParts added in v0.5.3

type RecordingParts interface {
	RecordingParts() []string
}

type Releaser added in v0.3.0

type Releaser interface {
	Release(ctx context.Context) error
}

type SettleResult

type SettleResult string
const (
	Changed  SettleResult = "changed"
	NoChange SettleResult = "no_change"
	Restless SettleResult = "timeout"
)

type Stall added in v0.5.3

type Stall struct {
	For     time.Duration
	Device  string
	Stopped bool
	Signs   []string
}

type StallReporter added in v0.5.3

type StallReporter interface {
	StallSince(t time.Time) Stall
}

type VideoClock added in v0.6.3

type VideoClock interface {
	VideoStarted(ctx context.Context, path string) (time.Time, bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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