Skip to content

Commit ad1238a

Browse files
committed
Merge pull request appium#94 from appium/isaac-app-strings
Add string file argument to driver.app_strings
2 parents 5823aba + e1f1dae commit ad1238a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

appium/webdriver/webdriver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,19 @@ def zoom(self, element=None, percent=200, steps=50):
309309
self.execute_script('mobile: pinchOpen', opts)
310310
return self
311311

312-
def app_strings(self, language=None):
312+
def app_strings(self, language=None, string_file=None):
313313
"""Returns the application strings from the device for the specified
314314
language.
315315
316316
:Args:
317317
- language - strings language code
318+
- string_file - the name of the string file to query
318319
"""
319320
data = {}
320321
if language != None:
321322
data['language'] = language
323+
if string_file != None:
324+
data['stringFile'] = string_file
322325
return self.execute(Command.GET_APP_STRINGS, data)['value']
323326

324327
def reset(self):

test/functional/android/appium_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ def test_app_strings(self):
4747
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])
4848

4949
def test_app_strings_with_language(self):
50-
strings = self.driver.app_strings("en")
50+
strings = self.driver.app_strings('en')
51+
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])
52+
53+
def test_app_strings_with_language_and_file(self):
54+
strings = self.driver.app_strings('en', 'some_file')
5155
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])
5256

5357
def test_press_keycode(self):

0 commit comments

Comments
 (0)