flow

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 14 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 DefaultDragDuration = 1000
View Source
const DefaultDragHold = 800
View Source
const DefaultTravelSpeed = 4.0

Variables

View Source
var DialogTypes = []string{"alert", "confirm", "prompt", "beforeunload"}
View Source
var HeaderKeys = []string{
	"appId", "url", "name", "tags", "env", "properties", "onFlowStart", "onFlowComplete",
	"jsEngine", "androidWebViewHierarchy",
	"devices",
}

Functions

func DialogButton added in v0.5.3

func DialogButton(s string) (cancel, ok bool)

func Latitude added in v0.5.3

func Latitude(s string) (float64, error)

func Longitude added in v0.5.3

func Longitude(s string) (float64, error)

func MaxRetries added in v0.5.3

func MaxRetries(s string) (int, error)

func NearestHeaderKey added in v0.5.3

func NearestHeaderKey(name string) string

func NormalizeOrientation

func NormalizeOrientation(s string) string

func RepeatTimes added in v0.5.3

func RepeatTimes(s string) (int, error)

func TravelSpeed added in v0.5.3

func TravelSpeed(s string) (float64, error)

Types

type ArgKV

type ArgKV struct {
	Key   string
	Value any
}

type Command

type Command struct {
	Name     string
	File     string
	Line     int
	Label    string
	Optional bool
	LabelRaw bool

	Selector *Selector

	Point                 string
	Repeat                int
	Delay                 int
	RetryTapIfNoChange    *bool
	WaitUntilVisible      bool
	WaitToSettleTimeoutMs int
	LongPress             bool

	Cond    *Condition
	Timeout string

	Text string

	RandomKind string
	Length     int

	Count int

	Direction string
	Start     string
	End       string
	From      *Selector
	Duration  int

	To   *Selector
	Hold int

	In               *Selector
	Speed            string
	VisibilityPct    int
	CenterElement    bool
	ScrollTimeoutSet bool

	AppID         string
	ClearState    bool
	ClearKeychain bool
	StopApp       *bool
	Permissions   []KV
	Arguments     []ArgKV

	AutoVerify bool
	Browser    bool

	SubFile    string
	SubFlow    *Flow
	Commands   []*Command
	Env        []KV
	When       *Condition
	Script     string
	Times      string
	While      *Condition
	MaxRetries string

	CropOn    *Selector
	Threshold string

	Latitude, Longitude string
	Points              [][2]float64
	TravelSpeed         string

	Files []string

	Enabled bool

	OutputVariable string

	Mock *NetworkMock

	Dialogs *DialogChoice

	DialogCheck *DialogCheck

	On            string
	Parallel      map[string][]*Command
	ParallelOrder []string
	Signal        string
}

func ParseCommands

func ParseCommands(dir string, data []byte) ([]*Command, error)

func (*Command) ForbidsTapReplay added in v0.6.0

func (c *Command) ForbidsTapReplay() bool

func (*Command) Mutating

func (c *Command) Mutating() bool

func (*Command) RetriesTapIfNoChange added in v0.6.0

func (c *Command) RetriesTapIfNoChange() bool

type Condition

type Condition struct {
	Platform   string
	Visible    *Selector
	NotVisible *Selector
	True       *string
	Label      string
	Timeout    string
}

type Config

type Config struct {
	AppID          string
	URL            string
	Name           string
	Tags           []string
	Env            []KV
	OnFlowStart    []*Command
	OnFlowComplete []*Command
	Properties     map[string]string
	PropertyOrder  []string
	Ext            map[string]any
	ExtLines       map[string]int

	Devices []*DeviceRole
}

func (*Config) AndroidWebViewDevTools added in v0.5.2

func (c *Config) AndroidWebViewDevTools() bool

func (*Config) Ignored added in v0.4.0

func (c *Config) Ignored() []string

func (*Config) Web

func (c *Config) Web() bool

type DeviceRole

type DeviceRole struct {
	Name     string
	Platform string
	Device   string
	AppID    string
	Env      []KV
}

type DialogCheck added in v0.5.3

type DialogCheck struct {
	Text    string
	HasText bool
	Type    string
}

type DialogChoice added in v0.5.3

type DialogChoice struct {
	Cancel  bool
	Button  string
	Text    string
	HasText bool
}

type DuplicateKey added in v0.5.3

type DuplicateKey struct {
	Key   string
	Line  int
	First int
}

type Error

type Error struct {
	File string
	Line int
	Msg  string
}

func (*Error) Error

func (e *Error) Error() string

type Flow

type Flow struct {
	Path     string
	Dir      string
	Config   Config
	Commands []*Command

	DuplicateKeys []DuplicateKey
}

func ParseBytes

func ParseBytes(path string, data []byte) (*Flow, error)

func ParseFile

func ParseFile(path string) (*Flow, error)

func (*Flow) FreshLaunch added in v0.5.1

func (f *Flow) FreshLaunch() *Command

func (*Flow) Name

func (f *Flow) Name() string

type KV

type KV struct {
	Key   string
	Value string
}

type NetworkMock added in v0.5.3

type NetworkMock struct {
	URL          string
	Method       string
	Status       int
	Body         string
	BodyFile     string
	BodyFromFile bool
	Headers      []KV
	Delay        int
	Fail         bool
}

type Selector

type Selector struct {
	Text  string
	ID    string
	Index string
	CSS   string

	Width, Height, Tolerance *int
	Enabled, Selected        *bool
	Checked, Focused         *bool
	Traits                   []string

	Below, Above, LeftOf, RightOf *Selector
	ContainsChild, ChildOf        *Selector
	ContainsDescendants           []*Selector

	Optional bool
}

func (*Selector) HasCriteria

func (s *Selector) HasCriteria() bool

Jump to

Keyboard shortcuts

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