mirror of
https://github.com/appium/appium.git
synced 2026-02-14 05:50:00 -06:00
Merge pull request #1299 from dandover/autoAcceptAlerts
Remove Alert Handling in iOS
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
8
app/uiauto/bootstrap.js
vendored
8
app/uiauto/bootstrap.js
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user