Merge pull request #4224 from sangeethasriniv/master

Add new capability stopAppOnReset for android
This commit is contained in:
Jonathan Lipps
2014-12-11 09:05:53 -08:00
6 changed files with 13 additions and 2 deletions

View File

@@ -50,6 +50,7 @@
|`intentCategory`| Intent category which will be used to start activity (default `android.intent.category.LAUNCHER`)| e.g. `android.intent.category.LAUNCHER`, `android.intent.category.APP_CONTACTS`
|`intentFlags`| Flags that will be used to start activity (default `0x10200000`)| e.g. `0x10200000`
|`optionalIntentArguments`| Additional intent arguments that will be used to start activity. See [Intent arguments](http://developer.android.com/tools/help/adb.html#IntentSpec) | e.g. `--esn <EXTRA_KEY>`, `--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>`, etc.
|`stopAppOnReset`| Stops the process of the app under test, before starting the app using adb. If the app under test is created by another anchor app, setting this false, allows the process of the anchor app to be still alive, during the start of the test app using adb, default `true`| `true` or `false`|
|`unicodeKeyboard`| Enable Unicode input, default `false`| `true` or `false`|
|`resetKeyboard`| Reset keyboard to its original state, after running Unicode tests with `unicodeKeyboard` capability. Ignored if used alone. Default `false`| `true` or `false`|
|`noSign`| Skip checking and signing of app with debug keys, will work only with UiAutomator and not with selendroid, default `false`| `true` or `false`|

View File

@@ -123,7 +123,7 @@ androidCommon.background = function (secs, cb) {
waitActivity: activity,
optionalIntentArguments: this.args.optionalIntentArguments,
retry: true,
stopApp: false
stopApp: this.args.stopAppOnReset
}, onStart);
}.bind(this), secs * 1000);
}.bind(this));

View File

@@ -393,7 +393,8 @@ Android.prototype.startApp = function (args, cb) {
flags: args.intentFlags,
waitPkg: args.appWaitPackage,
waitActivity: args.appWaitActivity,
optionalIntentArguments: args.optionalIntentArguments
optionalIntentArguments: args.optionalIntentArguments,
stopApp: args.stopAppOnReset
}, cb);
}
};

View File

@@ -388,6 +388,7 @@ Selendroid.prototype.createSession = function (cb) {
waitPkg: this.args.appWaitPackage,
waitActivity: this.args.appWaitActivity,
optionalIntentArguments: this.args.optionalIntentArguments,
stopApp: this.args.stopAppOnReset,
retry: false
}, onStart);
}

View File

@@ -67,6 +67,7 @@ var androidCaps = [
, 'resetKeyboard'
, 'noSign'
, 'ignoreUnimportantViews'
, 'stopAppOnReset'
];
var iosCaps = [

View File

@@ -607,6 +607,13 @@ var args = [
, example: "0x10200000"
, help: "(Android-only) Additional intent arguments that will be used to " +
"start activity"
}],
[['--stop-app-on-reset'], {
dest: 'stopAppOnReset'
, defaultValue: true
, required: false
, help: "(Android-only) Stops the app before restart"
}]
];