mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 21:39:41 +08:00
change: convertToAbsolutePoint, convertToAbsoluteCoordinates
This commit is contained in:
@@ -19,7 +19,6 @@ type ActionOptions struct {
|
||||
Direction interface{} `json:"direction,omitempty" yaml:"direction,omitempty"` // used by swipe to tap text or app
|
||||
Timeout int `json:"timeout,omitempty" yaml:"timeout,omitempty"` // TODO: wait timeout in seconds for mobile action
|
||||
Frequency int `json:"frequency,omitempty" yaml:"frequency,omitempty"`
|
||||
Relative bool `json:"relative,omitempty" yaml:"relative,omitempty"` // use relative coordinate
|
||||
|
||||
ScreenOptions
|
||||
|
||||
@@ -56,9 +55,6 @@ func (o *ActionOptions) Options() []ActionOption {
|
||||
if o.Steps != 0 {
|
||||
options = append(options, WithSteps(o.Steps))
|
||||
}
|
||||
if o.Relative {
|
||||
options = append(options, WithRelative(true))
|
||||
}
|
||||
|
||||
switch v := o.Direction.(type) {
|
||||
case string:
|
||||
@@ -260,13 +256,6 @@ func WithDirection(direction string) ActionOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithRelative set relative coordinate, (0, 0) is the top-left corner of the screen
|
||||
func WithRelative(relative bool) ActionOption {
|
||||
return func(o *ActionOptions) {
|
||||
o.Relative = relative
|
||||
}
|
||||
}
|
||||
|
||||
// WithCustomDirection inputs sx, sy, ex, ey
|
||||
func WithCustomDirection(sx, sy, ex, ey float64) ActionOption {
|
||||
return func(o *ActionOptions) {
|
||||
|
||||
Reference in New Issue
Block a user