Skip to content

Commit 995cd5b

Browse files
authored
sync video_fps (#162)
1 parent c1b9ee8 commit 995cd5b

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Read `release_notes.md` for commit level details.
1212
# 2
1313
Appium::Core.for caps: {...}, appium_lib: {...}
1414
```
15+
- Add `videoFps` param for screen recording in iOS(XCUITest) to sync with Appium 1.9.2
1516
1617
### Bug fixes
1718

lib/appium_lib_core/ios/xcuitest/device.rb

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ module Device
5757
# @param [String] time_limit: Recording time. 180 seconds is by default.
5858
# @param [String] video_quality: The video encoding quality (low, medium, high, photo - defaults to medium).
5959
# Only works for real devices.
60+
# @param [String] video_fps: The Frames Per Second rate of the recorded video. Change this value if the resulting video
61+
# is too slow or too fast. Defaults to 10.
6062
#
6163
# @example
6264
#

lib/appium_lib_core/ios/xcuitest/device/screen.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ def self.add_methods
88
::Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
99
# rubocop:disable Metrics/ParameterLists
1010
def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: nil, force_restart: nil,
11-
video_type: 'mp4', time_limit: '180', video_quality: 'medium')
11+
video_type: 'mp4', time_limit: '180', video_quality: 'medium', video_fps: nil)
1212
option = ::Appium::Core::Base::Device::ScreenRecord.new(
1313
remote_path: remote_path, user: user, pass: pass, method: method, force_restart: force_restart
1414
).upload_option
1515

1616
option[:videoType] = video_type
1717
option[:timeLimit] = time_limit
1818
option[:videoQuality] = video_quality
19+
option[:videoFps] = video_fps unless video_fps.nil?
1920

2021
execute(:start_recording_screen, {}, { options: option })
2122
end

test/unit/ios/device/w3c/commands_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def test_start_recording_screen
4444

4545
def test_start_recording_screen_custom
4646
stub_request(:post, "#{SESSION}/appium/start_recording_screen")
47-
.with(body: { options: { videoType: 'h265', timeLimit: '60', videoQuality: 'medium' } }.to_json)
47+
.with(body: { options: { videoType: 'h265', timeLimit: '60', videoQuality: 'medium', videoFps: '50' } }.to_json)
4848
.to_return(headers: HEADER, status: 200, body: { value: ['a'] }.to_json)
4949

50-
@driver.start_recording_screen video_type: 'h265', time_limit: '60'
50+
@driver.start_recording_screen video_type: 'h265', time_limit: '60', video_fps: '50'
5151

5252
assert_requested(:post, "#{SESSION}/appium/start_recording_screen", times: 1)
5353
end

0 commit comments

Comments
 (0)