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

add script param in setDeviceSysLocaleViaSettingApp #372

Merged
merged 10 commits into from
Nov 5, 2018

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Oct 31, 2018

related to: appium/io.appium.settings#23
After this PR, we can set script in setting locale.

*/
methods.setDeviceSysLocaleViaSettingApp = async function (language, country) {
await this.shell(['am', 'broadcast', '-a', LOCALE_SETTING_ACTION,
methods.setDeviceSysLocaleViaSettingApp = async function (language, country, script) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be more readable if we set script to null by default (script = null)

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered the way, too. I'll follow the way.

'-n', LOCALE_SETTING_RECEIVER,
'--es', 'lang', language.toLowerCase(),
'--es', 'country', country.toUpperCase()]);
'--es', 'country', country.toUpperCase()
].concat(_.isString(script) ? ['--es', 'script', script] : []);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather prefer to use this style:

if (script) {
  params.push('--es', 'script', script);
}

@mykola-mokhnach
Copy link
Contributor

I'll publish a new version of appium settings soon

@KazuCocoa
Copy link
Member Author

ca6515d is a commit to run e2e test.
With the latest io.appium.settings, locale related tests passed with 8.1 and 7.1 emulators on my local.

gulpfile.js Outdated

boilerplate({
build: 'appium-adb',
jscs: false,
e2eTest: { android: true }
testTimeout: 120000,
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 a global setting?

};

const avdName = process.env.ANDROID_AVD || 'NEXUS_S_18_X86';
const platformVersion = process.env.PLATFORM_VERSION || '4.3';
Copy link
Member Author

Choose a reason for hiding this comment

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

will back to ^

package.json Outdated
@@ -10,7 +10,7 @@
"watch": "gulp watch",
"build": "gulp transpile",
"mocha": "mocha",
"e2e-test": "gulp e2e-test",
"e2e-test": "gulp transpile && mocha --timeout 600000 build/test/functional/",
Copy link
Contributor

@imurchie imurchie Nov 2, 2018

Choose a reason for hiding this comment

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

This requires that mocha be globally installed. It would be better to be

"e2e-test": "gulp transpile && npm run mocha -- -t 600000 --recursive build/test/functional/",

// zh-hans-cn : zh-cn
const localeCode = script ? `${language}-${script.toLowerCase()}-${country}` : `${language}-${country}`;

if (localeCode === curLocale) {
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Nov 5, 2018

Choose a reason for hiding this comment

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

how about writing a small log message here?

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach left a comment

Choose a reason for hiding this comment

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

👍

@KazuCocoa KazuCocoa merged commit 679bc5c into appium:master Nov 5, 2018
@KazuCocoa KazuCocoa deleted the add_script_in_set_locale branch November 5, 2018 12:38
@KazuCocoa
Copy link
Member Author

KazuCocoa commented Nov 5, 2018

@mykola-mokhnach
Can you bump the version of this repository and publish it when you have a time?

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.

3 participants