fix: screen record duration

This commit is contained in:
lilong.129
2025-03-06 17:58:16 +08:00
parent 79e0323471
commit e8025f9e65
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
v5.0.0-beta-2503061750 v5.0.0-beta-2503061758
+3
View File
@@ -792,6 +792,9 @@ func (ad *ADBDriver) ScreenRecord(opts ...option.ActionOption) (videoPath string
} }
duration := options.ScreenRecordDuration duration := options.ScreenRecordDuration
if duration == 0 {
duration = options.Duration
}
audioOn := options.ScreenRecordWithAudio audioOn := options.ScreenRecordWithAudio
// get android system version // get android system version
+2 -1
View File
@@ -195,7 +195,8 @@ func TestDriver_ADB_ForegroundInfo(t *testing.T) {
func TestDriver_ADB_ScreenRecord(t *testing.T) { func TestDriver_ADB_ScreenRecord(t *testing.T) {
driver := setupADBDriverExt(t) driver := setupADBDriverExt(t)
path1, err := driver.ScreenRecord(option.WithScreenRecordDuation(182)) path1, err := driver.ScreenRecord(
option.WithScreenRecordDuation(5))
assert.Nil(t, err) assert.Nil(t, err)
defer os.Remove(path1) defer os.Remove(path1)
t.Log(path1) t.Log(path1)