Remove Alert Handling in Appium

This patchset removes support for Appium auto-accepting or
dismissing of alerts, specifically the useLocationServices
alert.
This commit is contained in:
Dan Dover
2013-10-11 16:08:52 -07:00
parent 3b103c81a9
commit 29aa03b53d
3 changed files with 0 additions and 21 deletions

View File

@@ -474,10 +474,6 @@ Appium.prototype.invoke = function() {
device.stop = function(cb) { cb(); };
this.devices[this.deviceType] = device;
} else if (this.isIos()) {
var useLocationServices = this.desiredCapabilities.useLocationServices;
if (useLocationServices !== false) {
useLocationServices = true;
}
var iosOpts = {
rest: this.rest
, webSocket: this.webSocket
@@ -496,7 +492,6 @@ Appium.prototype.invoke = function() {
, startingOrientation: this.desiredCapabilities.deviceOrientation || this.args.orientation
, robotPort: this.args.robotPort
, robotAddress: this.args.robotAddress
, useLocationServices: useLocationServices
};
this.devices[this.deviceType] = ios(iosOpts);
} else if (this.isAndroid()) {

View File

@@ -44,7 +44,6 @@ var IOS = function(args) {
this.reset = args.reset;
this.automationTraceTemplatePath = args.automationTraceTemplatePath;
this.removeTraceDir = args.removeTraceDir;
this.useLocationServices = args.useLocationServices;
this.deviceType = args.deviceType;
this.startingOrientation = args.startingOrientation || "PORTRAIT";
this.curOrientation = this.startingOrientation;
@@ -212,7 +211,6 @@ IOS.prototype.onInstrumentsLaunch = function(launchCb) {
async.series([
this.setBundleId.bind(this),
this.setInitialOrientation.bind(this),
this.setLocationServicesPref.bind(this),
this.navToInitialWebview.bind(this)
], function(err) {
if (err) return launchCb(err);
@@ -252,12 +250,6 @@ IOS.prototype.setInitialOrientation = function(cb) {
}
};
IOS.prototype.setLocationServicesPref = function(cb) {
var cmd = "setBootstrapConfig: useLocationServices=" +
JSON.stringify(this.useLocationServices);
this.proxy(cmd, cb);
};
IOS.prototype.navToInitialWebview = function(cb) {
if (this.autoWebview) {
this.navToFirstAvailWebview(cb);

View File

@@ -15,14 +15,6 @@ var cmd = getFirstCommand();
var bootstrapSettings = {};
UIATarget.onAlert = function(alert) {
var alertName = alert.name() || '';
if (alertName.indexOf("Use Your Current Location") !== -1) {
if (bootstrapSettings.useLocationServices) {
alert.buttons()["OK"].tap();
} else {
alert.buttons()[0].tap();
}
}
return true;
};
var result;