mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
feat: mark tap/swipe UI operation
This commit is contained in:
@@ -132,6 +132,7 @@ func (o *ActionOptions) Options() []ActionOption {
|
||||
|
||||
options = append(options, o.GetScreenShotOptions()...)
|
||||
options = append(options, o.GetScreenRecordOptions()...)
|
||||
options = append(options, o.GetMarkOperationOptions()...)
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ type ScreenOptions struct {
|
||||
ScreenShotOptions
|
||||
ScreenRecordOptions
|
||||
ScreenFilterOptions
|
||||
MarkOperationOptions
|
||||
}
|
||||
|
||||
type ScreenShotOptions struct {
|
||||
@@ -273,3 +274,29 @@ func WithIndex(index int) ActionOption {
|
||||
o.Index = index
|
||||
}
|
||||
}
|
||||
|
||||
// MarkOperationOptions contains options for marking UI operations
|
||||
type MarkOperationOptions struct {
|
||||
// mark UI operation, enable/disable UI operation marking
|
||||
MarkOperationEnabled bool `json:"mark_operation_enabled,omitempty" yaml:"mark_operation_enabled,omitempty"`
|
||||
}
|
||||
|
||||
func (o *MarkOperationOptions) GetMarkOperationOptions() []ActionOption {
|
||||
options := make([]ActionOption, 0)
|
||||
if o == nil {
|
||||
return options
|
||||
}
|
||||
|
||||
if o.MarkOperationEnabled {
|
||||
options = append(options, WithMarkOperationEnabled(true))
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
// WithMarkOperationEnabled enables or disables UI operation marking
|
||||
func WithMarkOperationEnabled(enabled bool) ActionOption {
|
||||
return func(o *ActionOptions) {
|
||||
o.MarkOperationEnabled = enabled
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user