Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls helpers.ensureDeviceLocale if the opts has either language or locale #477

Merged

Conversation

KazuCocoa
Copy link
Member

https://appium.slack.com/archives/C02956V3H/p1543739923001400

language or locale is mandatory. localeScript is option.
We can reduce warning messages for no language and no locale case.

@@ -635,7 +635,9 @@ helpers.initDevice = async function (adb, opts) {
await helpers.setMockLocationApp(adb, SETTINGS_HELPER_PKG_ID);
}

await helpers.ensureDeviceLocale(adb, opts.language, opts.locale, opts.localeScript);
if (opts.language || opts.locale) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be || or && ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| is fine here since if users set only language (or locale), then we should show a message in ensureDeviceLocale to guide them.
We can skip calling the ensureDeviceLocale when they do not specify both language and locale in their capability.

@KazuCocoa KazuCocoa merged commit 41c9a5f into appium:master Dec 2, 2018
@KazuCocoa KazuCocoa deleted the skip-ensuredevicelocale-no-options branch December 2, 2018 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants