Skip to content

Commit 78f92ff

Browse files
committed
Merge branch 'rgonalo-master'
2 parents 1eafb3b + d02de27 commit 78f92ff

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

appium/webdriver/webdriver.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,17 @@ def zoom(self, element=None, percent=200, steps=50):
311311
self.execute_script('mobile: pinchOpen', opts)
312312
return self
313313

314-
@property
315-
def app_strings(self):
316-
"""Returns the application strings from the device.
314+
def app_strings(self, language=None):
315+
"""Returns the application strings from the device for the specified
316+
language.
317317
318-
:Usage:
319-
strings = driver.app_strings
318+
:Args:
319+
- language - strings language code
320320
"""
321-
return self.execute(Command.GET_APP_STRINGS)['value']
321+
data = {}
322+
if language != None:
323+
data['language'] = language
324+
return self.execute(Command.GET_APP_STRINGS, data)['value']
322325

323326
def reset(self):
324327
"""Resets the current application on the device.
@@ -534,7 +537,7 @@ def _addCommands(self):
534537
self.command_executor._commands[Command.MULTI_ACTION] = \
535538
('POST', '/session/$sessionId/touch/multi/perform')
536539
self.command_executor._commands[Command.GET_APP_STRINGS] = \
537-
('GET', '/session/$sessionId/appium/app/strings')
540+
('POST', '/session/$sessionId/appium/app/strings')
538541
self.command_executor._commands[Command.PRESS_KEYCODE] = \
539542
('POST', '/session/$sessionId/appium/device/press_keycode')
540543
self.command_executor._commands[Command.LONG_PRESS_KEYCODE] = \

test/functional/android/appium_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def tearDown(self):
3434
self.driver.quit()
3535

3636
def test_app_strings(self):
37-
strings = self.driver.app_strings
37+
strings = self.driver.app_strings()
38+
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])
39+
40+
def test_app_strings_with_language(self):
41+
strings = self.driver.app_strings("en")
3842
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])
3943

4044
def test_press_keycode(self):

0 commit comments

Comments
 (0)