Skip to content

Commit

Permalink
Introduce skipDeviceInitialization capability (#480)
Browse files Browse the repository at this point in the history
The new capability is introduced, which is named 'skipDeviceInitialization'
and allows a user to skip device initialization phase.
  • Loading branch information
AnnaWyrwal authored and mykola-mokhnach committed Dec 14, 2018
1 parent e7306b5 commit 8beb7f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/android-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,16 +628,22 @@ helpers.verifyUnlock = async function (adb) {
};

helpers.initDevice = async function (adb, opts) {
await adb.waitForDevice();
// pushSettingsApp required before calling ensureDeviceLocale for API Level 24+
await helpers.pushSettingsApp(adb);
if (opts.skipDeviceInitialization) {
logger.info(`'skipDeviceInitialization' is set. Skipping device initialization.`);
} else {
await adb.waitForDevice();
// pushSettingsApp required before calling ensureDeviceLocale for API Level 24+
await helpers.pushSettingsApp(adb);
}

if (!opts.avd) {
await helpers.setMockLocationApp(adb, SETTINGS_HELPER_PKG_ID);
}

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

await adb.startLogcat();
if (opts.unicodeKeyboard) {
return await helpers.initUnicodeKeyboard(adb);
Expand Down
3 changes: 3 additions & 0 deletions lib/desired-caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ let commonCapConstraints = {
localeScript: {
isString: true
},
skipDeviceInitialization: {
isBoolean: true
}
};

let uiautomatorCapConstraints = {
Expand Down

0 comments on commit 8beb7f0

Please sign in to comment.