action

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionHandler

type ActionHandler interface {
	OnActionResponse(interface{}, *Response)
}

type ActionType

type ActionType int32
const (
	ActionType_Custom                ActionType = 0
	ActionType_GetSceneGraph         ActionType = 1
	ActionType_ElementIsDisplayed    ActionType = 2
	ActionType_ElementSetValue       ActionType = 3
	ActionType_ElementGetValue       ActionType = 4
	ActionType_Move                  ActionType = 5
	ActionType_TouchDown             ActionType = 6
	ActionType_TouchMove             ActionType = 7
	ActionType_TouchUp               ActionType = 8
	ActionType_DragAndDrop           ActionType = 9
	ActionType_LongTouch             ActionType = 10
	ActionType_ElementTouch          ActionType = 11
	ActionType_GetScreenshot         ActionType = 12
	ActionType_GetTests              ActionType = 13
	ActionType_ExecuteTest           ActionType = 14
	ActionType_ExecutionResult       ActionType = 15
	ActionType_Log                   ActionType = 16
	ActionType_UnityReset            ActionType = 17
	ActionType_Performance           ActionType = 18
	ActionType_NativeScript          ActionType = 19
	ActionType_ExecuteMethodStart    ActionType = 20
	ActionType_ExecuteMethodFinished ActionType = 21
)

type AppType

type AppType int32
const (
	AppType_Cocos AppType = 0
	AppType_Unity AppType = 1
)

type Connect

type Connect struct {
	CustomerId string  `json:"customerId"`
	AppID      string  `json:"appId"`
	AppType    AppType `json:"appType"`
	DeviceID   string  `json:"deviceId"`
	SessionID  string  `json:"sessionId"`
	Version    string  `json:"version"`
	AppVersion string  `json:"appVersion"`
}

type ContentType

type ContentType int32
const (
	ContentType_Flatbuffer ContentType = 0
	ContentType_Json       ContentType = 1
	ContentType_Xml        ContentType = 2
)

type Custom

type Custom struct {
	RequestData string
	Content     []byte
	Success     bool
}

func (*Custom) GetActionType

func (a *Custom) GetActionType() ActionType

func (*Custom) ProcessResponse

func (a *Custom) ProcessResponse(response *Response) error

func (*Custom) Serialize

func (a *Custom) Serialize() ([]byte, error)

type DragAndDrop

type DragAndDrop struct {
	From string
	To   string
}

func (*DragAndDrop) GetActionType

func (a *DragAndDrop) GetActionType() ActionType

func (*DragAndDrop) ProcessResponse

func (a *DragAndDrop) ProcessResponse(response *Response) error

func (*DragAndDrop) Serialize

func (a *DragAndDrop) Serialize() ([]byte, error)

type GetAttr

type GetAttr struct {
	Id   string `json:"id"`
	Attr string `json:"attr"`
}

type GetSceenGraph

type GetSceenGraph struct {
	// contains filtered or unexported fields
}

func (*GetSceenGraph) Content

func (a *GetSceenGraph) Content() string

func (*GetSceenGraph) FindElementID added in v1.1.0

func (a *GetSceenGraph) FindElementID(xpath string) (string, error)

FindElementID returns the ID attribute of the first element matching the XPath expression, preferring visible elements.

func (*GetSceenGraph) GetActionType

func (a *GetSceenGraph) GetActionType() ActionType

func (*GetSceenGraph) ProcessResponse

func (a *GetSceenGraph) ProcessResponse(response *Response) error

func (*GetSceenGraph) Serialize

func (a *GetSceenGraph) Serialize() ([]byte, error)

func (*GetSceenGraph) XML

func (a *GetSceenGraph) XML() (*xmlquery.Node, error)

func (*GetSceenGraph) XMLBytes added in v1.1.0

func (a *GetSceenGraph) XMLBytes(pretty bool) ([]byte, error)

XMLBytes returns the scene graph as XML. JSON scene graphs can't be converted and return an error.

type GetScreenshot

type GetScreenshot struct {
	Success bool
	// contains filtered or unexported fields
}

func (*GetScreenshot) GetActionType

func (a *GetScreenshot) GetActionType() ActionType

func (*GetScreenshot) Height

func (a *GetScreenshot) Height() int

func (*GetScreenshot) ProcessResponse

func (a *GetScreenshot) ProcessResponse(response *Response) error

func (*GetScreenshot) SceengraphXML

func (a *GetScreenshot) SceengraphXML() []byte

func (*GetScreenshot) ScreenshotData

func (a *GetScreenshot) ScreenshotData() []byte

func (*GetScreenshot) Serialize

func (a *GetScreenshot) Serialize() ([]byte, error)

func (*GetScreenshot) Width

func (a *GetScreenshot) Width() int

type GetValue

type GetValue struct {
	ElementID string
	Success   bool
	Attr      string
	Value     string
}

func (*GetValue) GetActionType

func (a *GetValue) GetActionType() ActionType

func (*GetValue) ProcessResponse

func (a *GetValue) ProcessResponse(response *Response) error

func (*GetValue) Serialize

func (a *GetValue) Serialize() ([]byte, error)

type Interface

type Interface interface {
	GetActionType() ActionType
	Serialize() ([]byte, error)
	ProcessResponse(response *Response) error
}

type IsDisplayed

type IsDisplayed struct {
	ElementID   string
	Success     bool
	IsDisplayed bool
}

func (*IsDisplayed) GetActionType

func (a *IsDisplayed) GetActionType() ActionType

func (*IsDisplayed) ProcessResponse

func (a *IsDisplayed) ProcessResponse(response *Response) error

func (*IsDisplayed) Serialize

func (a *IsDisplayed) Serialize() ([]byte, error)

type LogData

type LogData struct {
	Type    LogType  `json:"type"`
	Level   LogLevel `json:"level"`
	Message string   `json:"message"`
}

type LogLevel

type LogLevel int32
const (
	LogLevel_Debug     LogLevel = 0
	LogLevel_Info      LogLevel = 1
	LogLevel_Warning   LogLevel = 2
	LogLevel_Error     LogLevel = 3
	LogLevel_Exception LogLevel = 4
)

type LogType

type LogType int32
const (
	LogType_DeviceLog      LogType = 0
	LogType_StepLog        LogType = 1
	LogType_StatusLog      LogType = 2
	LogType_CheckpointLog  LogType = 3
	LogType_PerformanceLog LogType = 4
)

type LongTouchElement

type LongTouchElement struct {
	ElementID string
	Success   bool
}

func (*LongTouchElement) GetActionType

func (a *LongTouchElement) GetActionType() ActionType

func (*LongTouchElement) ProcessResponse

func (a *LongTouchElement) ProcessResponse(response *Response) error

func (*LongTouchElement) Serialize

func (a *LongTouchElement) Serialize() ([]byte, error)

type MoveElement

type MoveElement struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type MoveOffset

type MoveOffset struct {
	From int64 `json:"from"`
	To   int64 `json:"to"`
}

type Node

type Node struct {
	XMLName    xml.Name `xml:""`
	Class      string   `xml:"Class,attr"`
	Id         int32    `xml:"ID,attr"`
	Name       string   `xml:"Name,attr"`
	CSS        string   `xml:"CSS,attr"`
	X          int32    `xml:"X,attr"`
	Y          int32    `xml:"Y,attr"`
	RectangleX int32    `xml:"RectangleX,attr"`
	RectangleY int32    `xml:"RectangleY,attr"`
	IsVisible  byte     `xml:"isVisible,attr"`
	LabelText  string   `xml:"LabelText,attr"`
	Children   []Node   `xml:""`
}

type PerformanceData

type PerformanceData struct {
	Checkpoint  string  `json:"checkpoint"`
	CPU         float64 `json:"cpu"`
	Memory      float64 `json:"memory"`
	FPS         float64 `json:"fps"`
	VertexCount float64 `json:"vertexCount"`
	Triangles   float64 `json:"triangles"`
}

type Request

type Request struct {
	ActionID   string      `json:"actionID"`
	ActionType ActionType  `json:"actionType"`
	Payload    RequestData `json:"payload"`
}

type RequestData added in v1.0.0

type RequestData struct {
	Id          *string      `json:"id,omitempty"`
	Data        *[]byte      `json:"data,omitempty"`
	SetAttr     *SetAttr     `json:"setAttr,omitempty"`
	GetAttr     *GetAttr     `json:"getAttr,omitempty"`
	MoveOffset  *MoveOffset  `json:"moveOffset,omitempty"`
	Touch       *Touch       `json:"touch,omitempty"`
	MoveElement *MoveElement `json:"moveElement,omitempty"`
	Test        *Test        `json:"test,omitempty"`
}

type Response

type Response struct {
	ActionID   string       `json:"actionID"`
	ActionType ActionType   `json:"actionType"`
	Success    bool         `json:"success"`
	Payload    ResponseData `json:"payload"`
}

type ResponseData added in v1.0.0

type ResponseData struct {
	Visible         *bool            `json:"visible,omitempty"`
	Data            *[]byte          `json:"data,omitempty"`
	Value           *string          `json:"value,omitempty"`
	Screenshot      *Screenshot      `json:"screenshot,omitempty"`
	Connect         *Connect         `json:"connect,omitempty"`
	Tests           *Tests           `json:"tests,omitempty"`
	LogData         *LogData         `json:"logData,omitempty"`
	TestDetails     *TestDetails     `json:"testDetails,omitempty"`
	PerformanceData *PerformanceData `json:"performanceData,omitempty"`
}

type Screenshot

type Screenshot struct {
	Sceengraph  []byte      `json:"sceengraph"`
	Screenshot  []byte      `json:"screenshot"`
	ContentType ContentType `json:"contentType"`
}

type Scroll

type Scroll struct {
	OffsetX int64
	OffsetY int64
}

func (*Scroll) GetActionType

func (a *Scroll) GetActionType() ActionType

func (*Scroll) ProcessResponse

func (a *Scroll) ProcessResponse(response *Response) error

func (*Scroll) Serialize

func (a *Scroll) Serialize() ([]byte, error)

type SetAttr

type SetAttr struct {
	Id   string `json:"id"`
	Attr string `json:"attr"`
	Val  string `json:"val"`
}

type SetValue

type SetValue struct {
	ElementID string
	Success   bool
	Attr      string
	Value     string
}

func (*SetValue) GetActionType

func (a *SetValue) GetActionType() ActionType

func (*SetValue) ProcessResponse

func (a *SetValue) ProcessResponse(response *Response) error

func (*SetValue) Serialize

func (a *SetValue) Serialize() ([]byte, error)

type Test

type Test struct {
	Assembly   string            `json:"assembly"`
	Class      string            `json:"class"`
	Method     string            `json:"method"`
	Parameter  map[string]string `json:"parameter"`
	Categories []string          `json:"categories"`
}

type TestDetails

type TestDetails struct {
	Test       string   `json:"test"`
	Timeout    int64    `json:"timeout"`
	Categories []string `json:"categories"`
}

type TestStart

type TestStart struct {
	Assembly string
	Class    string
	Method   string
	Env      map[string]string
	Success  bool
}

func (*TestStart) GetActionType

func (a *TestStart) GetActionType() ActionType

func (*TestStart) ProcessResponse

func (a *TestStart) ProcessResponse(response *Response) error

func (*TestStart) Serialize

func (a *TestStart) Serialize() ([]byte, error)

type Tests

type Tests struct {
	Tests []Test `json:"tests"`
}

type TestsGet

type TestsGet struct {
	Tests   []Test
	Success bool
}

func (*TestsGet) GetActionType

func (a *TestsGet) GetActionType() ActionType

func (*TestsGet) ProcessResponse

func (a *TestsGet) ProcessResponse(response *Response) error

func (*TestsGet) Serialize

func (a *TestsGet) Serialize() ([]byte, error)

type Touch

type Touch struct {
	Id      string `json:"id"`
	Xoffset int64  `json:"xoffset"`
	Yoffset int64  `json:"yoffset"`
}

type TouchDownPosition

type TouchDownPosition struct {
	PosX    int64
	PosY    int64
	Success bool
}

func (*TouchDownPosition) GetActionType

func (a *TouchDownPosition) GetActionType() ActionType

func (*TouchDownPosition) ProcessResponse

func (a *TouchDownPosition) ProcessResponse(response *Response) error

func (*TouchDownPosition) Serialize

func (a *TouchDownPosition) Serialize() ([]byte, error)

type TouchElement

type TouchElement struct {
	ElementID string
	Success   bool
}

func (*TouchElement) GetActionType

func (a *TouchElement) GetActionType() ActionType

func (*TouchElement) ProcessResponse

func (a *TouchElement) ProcessResponse(response *Response) error

func (*TouchElement) Serialize

func (a *TouchElement) Serialize() ([]byte, error)

type TouchMovePosition

type TouchMovePosition struct {
	PosX    int64
	PosY    int64
	Success bool
}

func (*TouchMovePosition) GetActionType

func (a *TouchMovePosition) GetActionType() ActionType

func (*TouchMovePosition) ProcessResponse

func (a *TouchMovePosition) ProcessResponse(response *Response) error

func (*TouchMovePosition) Serialize

func (a *TouchMovePosition) Serialize() ([]byte, error)

type TouchUpPosition

type TouchUpPosition struct {
	PosX    int64
	PosY    int64
	Success bool
}

func (*TouchUpPosition) GetActionType

func (a *TouchUpPosition) GetActionType() ActionType

func (*TouchUpPosition) ProcessResponse

func (a *TouchUpPosition) ProcessResponse(response *Response) error

func (*TouchUpPosition) Serialize

func (a *TouchUpPosition) Serialize() ([]byte, error)

type UnityReset

type UnityReset struct {
	Assembly string
	Class    string
	Method   string
	Success  bool
}

func (*UnityReset) GetActionType

func (a *UnityReset) GetActionType() ActionType

func (*UnityReset) ProcessResponse

func (a *UnityReset) ProcessResponse(response *Response) error

func (*UnityReset) Serialize

func (a *UnityReset) Serialize() ([]byte, error)

Jump to

Keyboard shortcuts

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