actions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustSwipe

func MustSwipe(x1, y1, x2, y2 int)

MustSwipe function to swipe on the screen and panic if an error occurs.

Types

type Node

type Node struct {
	XMLName    xml.Name
	Attributes []xml.Attr `xml:",any,attr"`
	Children   []Node     `xml:",any"`
	Content    string     `xml:",chardata"`
}

Node represents a generic XML node

func GetPage

func GetPage() (*Node, error)

GetPage function to get the root node of the XML

func MustGetPage

func MustGetPage() *Node

MustGetPage function to get the root node of the XML and panic if not found.

func OpenChrome

func OpenChrome(url string, dest *adb.Adb) (*Node, error)

OpenChrome opens the Chrome browser on the device.

func (*Node) Bounds

func (node *Node) Bounds() (left, top, right, bottom int)

Bounds function to get the bounds of an element.

func (*Node) Class

func (node *Node) Class() string

Class function to get the class name of an element.

func (*Node) Click

func (node *Node) Click() error

Click function to click on an element.

func (Node) DoubleClick

func (node Node) DoubleClick() error

DoubleClick function to double click on an element.

func (*Node) ElementIsCheckable

func (node *Node) ElementIsCheckable() bool

ElementIsCheckable function to check if an element is checkable based on its ID.

func (*Node) ElementIsChecked

func (node *Node) ElementIsChecked() bool

ElementIsChecked function to check if an element is checked.

func (*Node) ElementIsClickable

func (node *Node) ElementIsClickable() bool

ElementIsClickable function to check if an element is clickable.

func (*Node) ElementIsEnabled

func (node *Node) ElementIsEnabled() bool

ElementIsEnabled function to check if an element is enabled.

func (*Node) ElementIsFocusable

func (node *Node) ElementIsFocusable() bool

ElementIsFocusable function to check if an element is focusable.

func (*Node) ElementIsFocused

func (node *Node) ElementIsFocused() bool

ElementIsFocused function to check if an element is focused.

func (*Node) ElementIsLongClickable

func (node *Node) ElementIsLongClickable() bool

ElementIsLongClickable function to check if an element is long clickable.

func (*Node) ElementIsPassword

func (node *Node) ElementIsPassword() bool

ElementIsPassword function to check if an element is a password field.

func (*Node) ElementIsScrollable

func (node *Node) ElementIsScrollable() bool

ElementIsScrollable function to check if an element is scrollable.

func (*Node) ElementIsSelected

func (node *Node) ElementIsSelected() bool

ElementIsSelected function to check if an element is selected.

func (*Node) ElementIsVisibleBasedOnContentDesc

func (node *Node) ElementIsVisibleBasedOnContentDesc(content string, timeout int) bool

ElementIsVisibleBasedOnContent function to check if an element is visible based on its content Desc.

func (*Node) ElementIsVisibleBasedOnID

func (node *Node) ElementIsVisibleBasedOnID(resourceId string, timeout int) bool

ElementIsVisibleBasedOnID function to check if an element is visible based on its ID.

func (*Node) ElementIsVisibleBasedOnText

func (node *Node) ElementIsVisibleBasedOnText(text string, timeout int) bool

ElementIsVisibleBasedOnText function to check if an element is visible based on its text.

func (*Node) FindElementByClass

func (node *Node) FindElementByClass(className string) (*Node, error)

FindElementByClass function to find an element by class.

func (*Node) FindElementByContentDesc

func (node *Node) FindElementByContentDesc(contentDesc string) (*Node, error)

FindElementByContentDesc function to find an element by content-desc.

func (*Node) FindElementById

func (node *Node) FindElementById(resourceId string) (*Node, error)

FindElementById function to find an element by id.

func (*Node) FindElementByText

func (node *Node) FindElementByText(text string) (*Node, error)

FindElementByText function to find an element by text.

func (*Node) Index

func (node *Node) Index() string

Index function to get the index of an element.

func (*Node) InsertText

func (node *Node) InsertText(text string) error

InsertText function to insert text into an element.

func (*Node) IsCheckable

func (node *Node) IsCheckable() bool

IsCheckable function to check if an element is checkable.

func (*Node) IsChecked

func (node *Node) IsChecked() bool

IsChecked function to check if an element is checked.

func (*Node) IsClickable

func (node *Node) IsClickable() bool

IsClickable function to check if an element is clickable.

func (*Node) IsEnabled

func (node *Node) IsEnabled() bool

IsEnabled function to check if an element is enabled.

func (*Node) IsFocusable

func (node *Node) IsFocusable() bool

IsFocusable function to check if an element is focusable.

func (*Node) IsFocused

func (node *Node) IsFocused() bool

IsFocused function to check if an element is focused.

func (*Node) IsLongClickable

func (node *Node) IsLongClickable() bool

IsLongClickable function to check if an element is long clickable.

func (*Node) IsPassword

func (node *Node) IsPassword() bool

IsPassword function to check if an element is a password field.

func (*Node) IsScrollable

func (node *Node) IsScrollable() bool

IsScrollable function to check if an element is scrollable.

func (*Node) IsSelected

func (node *Node) IsSelected() bool

IsSelected function to check if an element is selected.

func (*Node) LongClick

func (node *Node) LongClick(timeout int) error

LongClick function to long click on an element with given duration.

func (*Node) MustClick

func (node *Node) MustClick()

MustClick function to click on an element and panic if an error occurs.

func (*Node) MustDoubleClick

func (node *Node) MustDoubleClick()

MustDoubleClick function to double click on an element and panic if an error occurs.

func (*Node) MustGetElementByClass

func (node *Node) MustGetElementByClass(className string) *Node

MustGetElementByClass function to find an element by class and panic if not found.

func (*Node) MustGetElementByContentDesc

func (node *Node) MustGetElementByContentDesc(contentDesc string) *Node

MustGetElementByContentDesc function to find an element by content-desc and panic if not found.

func (*Node) MustGetElementById

func (node *Node) MustGetElementById(resourceId string) *Node

MustGetElementById function to find an element by id and panic if not found.

func (*Node) MustGetElementByText

func (node *Node) MustGetElementByText(text string) *Node

MustGetElementByText function to find an element by text and panic if not found.

func (*Node) MustInsertText

func (node *Node) MustInsertText(text string)

MustInsertText function to insert text into an element and panic if an error occurs.

func (*Node) MustLongClick

func (node *Node) MustLongClick(timeout int)

MustLongClick function to long click on an element with given duration and panic if an error occurs.

func (*Node) Package

func (node *Node) Package() string

Package function to get the package name of an element.

func (*Node) ResourceID

func (node *Node) ResourceID() string

ResourceID function to get the resource ID of an element.

func (Node) Swipe

func (node Node) Swipe(x1, y1, x2, y2 int) error

Swipe function to swipe on the screen.

func (*Node) Text

func (node *Node) Text() string

Text function to get the text of an element.

Jump to

Keyboard shortcuts

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