Skip to content

Commit b9e47aa

Browse files
committed
docs: add docstring
1 parent 954a2fe commit b9e47aa

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

lib/appium_lib_core/common/base/driver.rb

+16-2
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,24 @@ def initialize(bridge)
164164
@bridge = bridge
165165
end
166166

167+
# Get appium Settings for current test session.
168+
#
169+
# @example
170+
#
171+
# @driver.settings.get
172+
#
167173
def get
168174
@bridge.get_settings
169175
end
170176

177+
# Update Appium Settings for current test session
178+
#
179+
# @param [Hash] settings Settings to update, keys are settings, values to value to set each setting to
180+
#
181+
# @example
182+
#
183+
# @driver.settings.update({'allowInvisibleElements': true})
184+
#
171185
def update(settings)
172186
@bridge.update_settings(settings)
173187
end
@@ -204,8 +218,8 @@ def get_settings
204218
#
205219
# @example
206220
#
207-
# @driver.update_settings('allowInvisibleElements': true)
208-
# @driver.settings.update('allowInvisibleElements': true)
221+
# @driver.update_settings({ 'allowInvisibleElements': true })
222+
# @driver.settings.update({ 'allowInvisibleElements': true })
209223
# @driver.settings = { 'allowInvisibleElements': true }
210224
#
211225
def settings=(value)

test/functional/android/android/device_data_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def test_settings
5656

5757
assert_equal(false, @driver.get_settings['ignoreUnimportantViews'])
5858

59-
@driver.update_settings('ignoreUnimportantViews' => true)
59+
@driver.update_settings({ 'ignoreUnimportantViews' => true })
6060
assert_equal(true, @driver.get_settings['ignoreUnimportantViews'])
6161

62-
@driver.update_settings('ignoreUnimportantViews' => false)
62+
@driver.update_settings({ 'ignoreUnimportantViews' => false })
6363
assert_equal(false, @driver.get_settings['ignoreUnimportantViews'])
6464
end
6565

test/functional/ios/ios/device_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ def test_pull_folder
196196
def test_settings
197197
assert_equal(false, @@driver.get_settings['nativeWebTap'])
198198

199-
@@driver.update_settings('nativeWebTap' => true)
199+
@@driver.update_settings({ 'nativeWebTap' => true })
200200
assert_equal(true, @@driver.get_settings['nativeWebTap'])
201201

202-
@@driver.update_settings('nativeWebTap' => false)
202+
@@driver.update_settings({ 'nativeWebTap' => false })
203203
end
204204

205205
def test_touch_actions

test/unit/android/device/mjsonwp/commands_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def test_update_settings
203203
stub_request(:post, "#{SESSION}/appium/settings")
204204
.to_return(headers: HEADER, status: 200, body: { value: '' }.to_json)
205205

206-
@driver.update_settings(sample: 'value')
206+
@driver.update_settings({ sample: 'value' })
207207

208208
assert_requested(:post, "#{SESSION}/appium/settings", times: 1)
209209
end

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_update_settings
202202
stub_request(:post, "#{SESSION}/appium/settings")
203203
.to_return(headers: HEADER, status: 200, body: { value: '' }.to_json)
204204

205-
@driver.update_settings(sample: 'value')
205+
@driver.update_settings({ sample: 'value' })
206206

207207
assert_requested(:post, "#{SESSION}/appium/settings", times: 1)
208208
end

0 commit comments

Comments
 (0)