Skip to content

Commit 67df100

Browse files
authored
Add filters for start_recording_screen, ios, tweak yardoc (#229)
* add video_filters * tweak yardoc syntax * use ' instead of ` in example * update changelog
1 parent 2129d17 commit 67df100

File tree

20 files changed

+143
-134
lines changed

20 files changed

+143
-134
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Read `release_notes.md` for commit level details.
55
## [Unreleased]
66

77
### Enhancements
8+
- Add `video_filters` argument for `start_recording_screen` iOS
9+
- It is available over Appium 1.15.0
810

911
### Bug fixes
1012

lib/appium_lib_core/android/device.rb

+12-12
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module Device
7777
# Same as #network_connection_type in selenium-webdriver.
7878
#
7979
# Returns a key of <code>{:airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0}</code> in #network_connection_type
80-
# Returns a number of the mode in `#get_network_connection`
80+
# Returns a number of the mode in +#get_network_connection+
8181
#
8282
# @example
8383
#
@@ -129,7 +129,7 @@ module Device
129129
# Defaults to 'Done' for iOS(except for XCUITest).
130130
# @param [Symbol] strategy The symbol of the strategy which closes the keyboard.
131131
# XCUITest ignore this argument.
132-
# Default for iOS is `:pressKey`. Default for Android is `:tapOutside`.
132+
# Default for iOS is +:pressKey+. Default for Android is +:tapOutside+.
133133
#
134134
# @example
135135
#
@@ -154,12 +154,12 @@ module Device
154154
# @option opts [String] :app_activity The target activity [required]
155155
# @option opts [String] :app_wait_package The package to start before the target package [optional]
156156
# @option opts [String] :app_wait_activity The activity to start before the target activity [optional]
157-
# @option opts [String] :intent_action The intent action to give it when start the target activity (`-a`) [optional]
158-
# @option opts [String] :intent_category The intent category to give it when start the target activity (`-c`) [optional]
159-
# @option opts [String] :intent_flags The intent flag to give it when start the target activity (`-f`) [optional]
157+
# @option opts [String] :intent_action The intent action to give it when start the target activity (+-a+) [optional]
158+
# @option opts [String] :intent_category The intent category to give it when start the target activity (+-c+) [optional]
159+
# @option opts [String] :intent_flags The intent flag to give it when start the target activity (+-f+) [optional]
160160
# @option opts [String] :optional_intent_arguments The optional intent action to give it when start the target activity [optional]
161161
# You can set arbitrary arguments with space as string.
162-
# e.g. `'--ez your_extra_bool bool --ei your_extra_int 1'`
162+
# e.g. +'--ez your_extra_bool bool --ei your_extra_int 1'+
163163
# @option opts [bool] :dont_stop_app_on_reset Do not stop the app when the reset is called in Appium create/delete session [optional]
164164
#
165165
# @example
@@ -170,7 +170,7 @@ module Device
170170

171171
# @!method set_network_connection(mode)
172172
# Set the device network connection mode
173-
# Same as `#network_connection_type` in selenium-webdriver.
173+
# Same as +#network_connection_type+ in selenium-webdriver.
174174
#
175175
# @param [String] mode Bit mask that represent the network mode
176176
# Or the key matched with <code>{:airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0}</code>
@@ -204,7 +204,7 @@ module Device
204204
# Get the resource usage information of the application.
205205
# https://github.com/appium/appium-base-driver/blob/be29aec2318316d12b5c3295e924a5ba8f09b0fb/lib/mjsonwp/routes.js#L303
206206
# @param [String] package_name: Package name
207-
# @param [String] data_type: Data type get with `get_performance_data_types`
207+
# @param [String] data_type: Data type get with +get_performance_data_types+
208208
# @param [String] data_read_timeout: Command timeout. Default is 2.
209209
#
210210
# @example
@@ -220,13 +220,13 @@ module Device
220220
# An exception will be thrown if the generated media file is too big to
221221
# fit into the available process memory.
222222
# This option only has an effect if there is screen recording process in progress
223-
# and `forceRestart` parameter is not set to `true`.
223+
# and +forceRestart+ parameter is not set to +true+.
224224
# @param [String] user The name of the user for the remote authentication.
225225
# @param [String] pass The password for the remote authentication.
226226
# @param [String] method The http multipart upload method name. The 'PUT' one is used by default.
227227
# @param [Boolean] force_restart Whether to try to catch and upload/return the currently running screen recording
228-
# (`false`, the default setting on server) or ignore the result of it
229-
# and start a new recording immediately (`true`).
228+
# (+false+, the default setting on server) or ignore the result of it
229+
# and start a new recording immediately (+true+).
230230
#
231231
# @param [String] video_size The format is widthxheight.
232232
# The default value is the device's native display resolution (if supported),
@@ -241,7 +241,7 @@ module Device
241241
# present then the most recent screen recording chunk is going to be returned as the result.
242242
# @param [String] bit_rate The video bit rate for the video, in megabits per second.
243243
# 4 Mbp/s(4000000) is by default for Android API level below 27. 20 Mb/s(20000000) for API level 27 and above.
244-
# @param [Boolean] bug_report Set it to `true` in order to display additional information on the video overlay,
244+
# @param [Boolean] bug_report Set it to +true+ in order to display additional information on the video overlay,
245245
# such as a timestamp, that is helpful in videos captured to illustrate bugs.
246246
# This option is only supported since API level 27 (Android P).
247247
#

lib/appium_lib_core/android/uiautomator2/device.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module Device
3030
# Battery level in range [0.0, 1.0], where 1.0 means 100% charge. -1 is returned
3131
# if the actual value cannot be retrieved from the system.
3232
# Battery state. The following symbols are possible
33-
# `:unknown, :charging, :discharging, :not_charging, :full`
33+
# +:unknown, :charging, :discharging, :not_charging, :full+
3434
#
3535
# @example
3636
#

lib/appium_lib_core/common/base/bridge.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ def self.handshake(**opts)
5858

5959
# Override
6060
# Creates session handling both OSS and W3C dialects.
61-
# Copy from Selenium::WebDriver::Remote::Bridge to keep using `merged_capabilities` for Appium
61+
# Copy from Selenium::WebDriver::Remote::Bridge to keep using +merged_capabilities+ for Appium
6262
#
63-
# If `desired_capabilities` has `forceMjsonwp: true` in the capability, this bridge works with mjsonwp protocol.
64-
# If `forceMjsonwp: false` or no the capability, it depends on server side whether this bridge works as w3c or mjsonwp.
63+
# If +desired_capabilities+ has +forceMjsonwp: true+ in the capability, this bridge works with mjsonwp protocol.
64+
# If +forceMjsonwp: false+ or no the capability, it depends on server side whether this bridge works as w3c or mjsonwp.
6565
#
6666
# @param [::Selenium::WebDriver::Remote::W3C::Capabilities, Hash] desired_capabilities A capability
6767
# @return [::Selenium::WebDriver::Remote::Capabilities, ::Selenium::WebDriver::Remote::W3C::Capabilities]
@@ -125,7 +125,7 @@ def create_session(desired_capabilities)
125125
json_create(oss_status, value)
126126
end
127127

128-
# Append `appium:` prefix for Appium following W3C spec
128+
# Append +appium:+ prefix for Appium following W3C spec
129129
# https://www.w3.org/TR/webdriver/#dfn-validate-capabilities
130130
#
131131
# @param [::Selenium::WebDriver::Remote::W3C::Capabilities, Hash] capabilities A capability

lib/appium_lib_core/common/base/bridge/w3c.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ def sessions
4343
end
4444

4545
# Perform touch actions for W3C module.
46-
# Generate `touch` pointer action here and users can use this via `driver.action`
46+
# Generate +touch+ pointer action here and users can use this via +driver.action+
4747
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/W3CActionBuilder.html
4848
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html
4949
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html
5050
#
51-
# 'mouse' action is by default in the Ruby client. Appium server force the `mouse` action to `touch` once in
51+
# 'mouse' action is by default in the Ruby client. Appium server force the +mouse+ action to +touch+ once in
5252
# the server side. So we don't consider the case.
5353
#
5454
# @example
5555
#
5656
# element = @driver.find_element(:id, "some id")
57-
# @driver.action.click(element).perform # The `click` is a part of `PointerActions`
57+
# @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
5858
#
5959
def action(async = false)
6060
# Used for default duration of each touch actions
@@ -143,29 +143,29 @@ def convert_to_element(id)
143143

144144
# For Appium
145145
# override
146-
# called in `extend DriverExtensions::HasNetworkConnection`
146+
# called in 'extend DriverExtensions::HasNetworkConnection'
147147
def network_connection
148148
execute :get_network_connection
149149
end
150150

151151
# For Appium
152152
# override
153-
# called in `extend DriverExtensions::HasNetworkConnection`
153+
# called in 'extend DriverExtensions::HasNetworkConnection'
154154
def network_connection=(type)
155155
execute :set_network_connection, {}, { parameters: { type: type } }
156156
end
157157

158158
# For Appium
159159
# No implementation for W3C webdriver module
160-
# called in `extend DriverExtensions::HasLocation`
160+
# called in 'extend DriverExtensions::HasLocation'
161161
def location
162162
obj = execute(:get_location) || {}
163163
::Selenium::WebDriver::Location.new obj['latitude'], obj['longitude'], obj['altitude']
164164
end
165165

166166
# For Appium
167167
# No implementation for W3C webdriver module
168-
# called in `extend DriverExtensions::HasLocation`
168+
# called in +extend DriverExtensions::HasLocation+
169169
# It has below code as well. We should consider the same context in Selenium 4 as backward compatibility.
170170
#
171171
# def location=(loc)

0 commit comments

Comments
 (0)