mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-13 17:29:56 +08:00
fix: failed to set duration option of swipe action
This commit is contained in:
@@ -891,7 +891,7 @@ func NewData(data map[string]interface{}, options ...DataOption) *DataOptions {
|
||||
}
|
||||
|
||||
if _, ok := dataOptions.Data["duration"]; !ok {
|
||||
dataOptions.Data["duration"] = 1.0 // default duration
|
||||
dataOptions.Data["duration"] = 0 // default duration
|
||||
}
|
||||
|
||||
if _, ok := dataOptions.Data["frequency"]; !ok {
|
||||
|
||||
@@ -440,12 +440,10 @@ func (wd *wdaDriver) DragFloat(fromX, fromY, toX, toY float64, options ...DataOp
|
||||
}
|
||||
|
||||
func (wd *wdaDriver) Swipe(fromX, fromY, toX, toY int, options ...DataOption) error {
|
||||
options = append(options, WithDataPressDuration(0))
|
||||
return wd.SwipeFloat(float64(fromX), float64(fromY), float64(toX), float64(toY), options...)
|
||||
}
|
||||
|
||||
func (wd *wdaDriver) SwipeFloat(fromX, fromY, toX, toY float64, options ...DataOption) error {
|
||||
options = append(options, WithDataPressDuration(0))
|
||||
return wd.DragFloat(fromX, fromY, toX, toY, options...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user