feat: support ignoreNotFoundError, ignore error if target element not found

This commit is contained in:
debugtalk
2022-08-31 16:38:15 +08:00
parent f2b25df87e
commit 90a4ee59f9
5 changed files with 66 additions and 24 deletions

View File

@@ -54,6 +54,23 @@ const (
type MobileAction struct {
Method MobileMethod `json:"method" yaml:"method"`
Params interface{} `json:"params,omitempty" yaml:"params,omitempty"`
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 WithTimeout(timeout int) ActionOption {
return func(o *MobileAction) {
o.timeout = timeout
}
}
func WithIgnoreNotFoundError(ignoreError bool) ActionOption {
return func(o *MobileAction) {
o.ignoreNotFoundError = ignoreError
}
}
type StepResult struct {