mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
feat: SwipeToTapApp, SwipeToTapText
This commit is contained in:
11
hrp/step.go
11
hrp/step.go
@@ -49,18 +49,29 @@ const (
|
||||
uiSelectorImage string = "ui_image"
|
||||
assertionExists string = "exists"
|
||||
assertionNotExists string = "not_exists"
|
||||
|
||||
// custom actions
|
||||
swipeToTapApp MobileMethod = "swipe_to_tap_app" // swipe left & right to find app and tap
|
||||
swipeToTapText MobileMethod = "swipe_to_tap_text" // swipe up & down to find text and tap
|
||||
)
|
||||
|
||||
type MobileAction struct {
|
||||
Method MobileMethod `json:"method" yaml:"method"`
|
||||
Params interface{} `json:"params,omitempty" yaml:"params,omitempty"`
|
||||
|
||||
maxRetryTimes int // max retry times
|
||||
timeout int // TODO: wait timeout in seconds for mobile action
|
||||
ignoreNotFoundError bool // ignore error if target element not found
|
||||
}
|
||||
|
||||
type ActionOption func(o *MobileAction)
|
||||
|
||||
func WithMaxRetryTimes(maxRetryTimes int) ActionOption {
|
||||
return func(o *MobileAction) {
|
||||
o.maxRetryTimes = maxRetryTimes
|
||||
}
|
||||
}
|
||||
|
||||
func WithTimeout(timeout int) ActionOption {
|
||||
return func(o *MobileAction) {
|
||||
o.timeout = timeout
|
||||
|
||||
Reference in New Issue
Block a user