Skip to content

Commit

Permalink
moved locale_script_options to descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsuryaprasad committed Jul 4, 2023
1 parent aac90f4 commit 56ac68e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
41 changes: 25 additions & 16 deletions appium/options/android/common/localization/locale_script_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,33 @@

from typing import Optional

from appium.options.base_options_descriptor import OptionsDescriptor
from appium.options.common.supports_capabilities import SupportsCapabilities

LOCALE_SCRIPT = "localeScript"


class LocaleScriptOption(SupportsCapabilities):
@property
def locale_script(self) -> Optional[str]:
"""
Canonical name of the locale to be set for the app under test.
"""
return self.get_capability(LOCALE_SCRIPT)
LOCALE_SCRIPT = "localeScript"
locale_script = OptionsDescriptor[Optional[str], str](LOCALE_SCRIPT)
"""
Gets and Sets canonical name of the locale to be set for the app under test,
for example zh-Hans-CN.
See https://developer.android.com/reference/java/util/Locale.html for more details.
Usage
-----
- Get
- `self.locale_script`
- Set
- `self.locale_script` = `value`
Parameters
----------
`value`: `str`
@locale_script.setter
def locale_script(self, value: str) -> None:
"""
Set canonical name of the locale to be set for the app under test,
for example zh-Hans-CN.
See https://developer.android.com/reference/java/util/Locale.html for more details.
"""
self.set_capability(LOCALE_SCRIPT, value)
Returns
-------
- Get
- `Optional[str]`
- Set
- `None`
"""
Loading

0 comments on commit 56ac68e

Please sign in to comment.