mirror of
https://github.com/appium/appium.git
synced 2026-10-25 10:17:00 +08:00
Make fullReset clear app on session stop as well
This commit is contained in:
@@ -602,6 +602,7 @@ Appium.prototype.initDevice = function () {
|
||||
, reset: !this.args.noReset
|
||||
, fastReset: this.fastReset
|
||||
, fastClear: this.desiredCapabilities.fastClear
|
||||
, fullReset: this.fullReset
|
||||
, useKeystore: this.args.useKeystore
|
||||
, keystorePath: this.args.keystorePath
|
||||
, keystorePassword: this.args.keystorePassword
|
||||
@@ -631,6 +632,7 @@ Appium.prototype.initDevice = function () {
|
||||
, reset: !this.args.noReset
|
||||
, systemPort: this.args.selendroidPort
|
||||
, fastReset: this.fastReset
|
||||
, fullReset: this.fullReset
|
||||
, useKeystore: this.args.useKeystore
|
||||
, keystorePath: this.args.keystorePath
|
||||
, keystorePassword: this.args.keystorePassword
|
||||
|
||||
@@ -318,6 +318,18 @@ Android.prototype.requestXmlCompression = function (cb) {
|
||||
|
||||
Android.prototype.stop = function (cb) {
|
||||
this.shuttingDown = true;
|
||||
|
||||
if (this.opts.fullReset) {
|
||||
logger.info("Removing app from device");
|
||||
this.uninstallApp(function (err) {
|
||||
if (err) {
|
||||
// simply warn on error here, because we don't want to stop the shutdown
|
||||
// process
|
||||
logger.warn(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.adb) {
|
||||
this.adb.goToHome(function () {
|
||||
this.shutdown(cb);
|
||||
|
||||
@@ -169,6 +169,17 @@ Selendroid.prototype.checkSelendroidCerts = function (cb) {
|
||||
};
|
||||
|
||||
Selendroid.prototype.stop = function (cb) {
|
||||
if (this.opts.fullReset) {
|
||||
logger.info("Removing app from device");
|
||||
this.uninstallApp(function (err) {
|
||||
if (err) {
|
||||
// simply warn on error here, because we don't want to stop the shutdown
|
||||
// process
|
||||
logger.warn(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
logger.info("Stopping selendroid server");
|
||||
this.deleteSession(function (err) {
|
||||
cb(err ? 1 : 0);
|
||||
|
||||
@@ -98,8 +98,9 @@ var args = [
|
||||
, dest: 'fullReset'
|
||||
, action: 'storeTrue'
|
||||
, required: false
|
||||
, help: '(iOS) Delete the entire simulator folder. (Android) Reset app state by uninstalling app instead of ' +
|
||||
'clearing app data'
|
||||
, help: '(iOS) Delete the entire simulator folder. (Android) Reset app ' +
|
||||
'state by uninstalling app instead of clearing app data. On ' +
|
||||
'Android, this will also remove the app after the session is complete.'
|
||||
, nargs: 0
|
||||
}],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user