mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: screen record with scrcpy
This commit is contained in:
+13
-3
@@ -127,9 +127,10 @@ func WithScreenShotFileName(fileName string) ActionOption {
|
||||
}
|
||||
|
||||
type ScreenRecordOptions struct {
|
||||
ScreenRecordDuration float64 `json:"screenrecord_duration,omitempty" yaml:"screenrecord_duration,omitempty"`
|
||||
ScreenRecordWithAudio bool `json:"screenrecord_with_audio,omitempty" yaml:"screenrecord_with_audio,omitempty"`
|
||||
ScreenRecordPath string `json:"screenrecord_path,omitempty" yaml:"screenrecord_path,omitempty"`
|
||||
ScreenRecordDuration float64 `json:"screenrecord_duration,omitempty" yaml:"screenrecord_duration,omitempty"`
|
||||
ScreenRecordWithAudio bool `json:"screenrecord_with_audio,omitempty" yaml:"screenrecord_with_audio,omitempty"`
|
||||
ScreenRecordWithScrcpy bool `json:"screenrecord_with_scrcpy,omitempty" yaml:"screenrecord_with_scrcpy,omitempty"`
|
||||
ScreenRecordPath string `json:"screenrecord_path,omitempty" yaml:"screenrecord_path,omitempty"`
|
||||
}
|
||||
|
||||
func (o *ScreenRecordOptions) GetScreenRecordOptions() []ActionOption {
|
||||
@@ -145,6 +146,9 @@ func (o *ScreenRecordOptions) GetScreenRecordOptions() []ActionOption {
|
||||
if o.ScreenRecordWithAudio {
|
||||
options = append(options, WithScreenRecordAudio(true))
|
||||
}
|
||||
if o.ScreenRecordWithScrcpy {
|
||||
options = append(options, WithScreenRecordScrcpy(true))
|
||||
}
|
||||
if o.ScreenRecordPath != "" {
|
||||
options = append(options, WithScreenRecordPath(o.ScreenRecordPath))
|
||||
}
|
||||
@@ -163,6 +167,12 @@ func WithScreenRecordAudio(audioOn bool) ActionOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithScreenRecordScrcpy(scrcpyOn bool) ActionOption {
|
||||
return func(o *ActionOptions) {
|
||||
o.ScreenRecordWithScrcpy = scrcpyOn
|
||||
}
|
||||
}
|
||||
|
||||
func WithScreenRecordPath(path string) ActionOption {
|
||||
return func(o *ActionOptions) {
|
||||
o.ScreenRecordPath = path
|
||||
|
||||
Reference in New Issue
Block a user