Skip to content

Commit

Permalink
finish porting ios args
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Mar 4, 2014
1 parent 0cd14dd commit b45f324
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 146 deletions.
49 changes: 2 additions & 47 deletions lib/appium.js
Expand Up @@ -31,7 +31,6 @@ var Appium = function (args) {
this.oldDesiredCapabilities = {};
this.session = null;
this.preLaunched = false;
this.fullReset = this.args.fullReset;
this.fastReset = !this.args.fullReset && !this.args.noReset;
this.sessionOverride = this.args.sessionOverride;
this.resetting = false;
Expand Down Expand Up @@ -187,13 +186,6 @@ Appium.prototype.configure = function (args, desiredCaps, cb) {
return cb(new Error("Device " + deviceType + " not configured yet"));
}
this.device = this.getDevice(deviceType);
var capOverrides = [
"app"
, "launchTimeout"
];
_.each(capOverrides, function (cap) {
args[cap] = desiredCaps[cap] || args[cap];
}.bind(this));
this.device.configure(args, desiredCaps, cb);
};

Expand Down Expand Up @@ -262,43 +254,6 @@ Appium.prototype.getDevice = function (deviceType) {
});
return new Device();

if (deviceType === DT_IOS) {

var iosOpts = {
, bundleId: this.args.bundleId || this.desiredCapabilities.bundleId
, udid: this.args.udid
, fullReset: this.fullReset
, verbose: !this.args.quiet
, automationTraceTemplatePath: this.args.automationTraceTemplatePath
, removeTraceDir: !this.args.keepArtifacts
, withoutDelay: !(typeof this.desiredCapabilities.nativeInstrumentsLib !== 'undefined' ?
this.desiredCapabilities.nativeInstrumentsLib : this.args.nativeInstrumentsLib)
, reset: !this.args.noReset
, launchTimeout: this.desiredCapabilities.launchTimeout || this.args.launchTimeout
, version: this.desiredCapabilities.version
, deviceName: this.desiredCapabilities.deviceName || this.desiredCapabilities.device || this.args.deviceName
, defaultDevice: this.args.defaultDevice
, forceiPhone: this.args.forceIphone
, forceiPad: this.args.forceIpad
, language: this.desiredCapabilities.language || this.args.language
, locale: this.desiredCapabilities.locale || this.args.locale
, calendarFormat: this.desiredCapabilities.calendarFormat || this.args.calendarFormat
, startingOrientation: this.desiredCapabilities.deviceOrientation || this.args.orientation
, showSimulatorLog: this.args.showSimulatorLog
, robotPort: this.args.robotPort
, robotAddress: this.args.robotAddress
, isSafariLauncherApp: this.isSafariLauncherApp
, desiredCapabilities: this.desiredCapabilities
, logNoColors: this.args.logNoColors
, flakeyRetries: this.args.backendRetries
, autoAcceptAlerts: this.desiredCapabilities.autoAcceptAlerts
, keepKeyChains: this.args.keepKeyChains || this.desiredCapabilities.keepKeyChains
};
if (this.desiredCapabilities.safari || this.desiredCapabilities.iwebview) {
this.device = new Safari(iosOpts);
} else {
this.device = new IOS(iosOpts);
}
} else if (this.isAndroid()) {
var androidOpts = {
rest: this.rest
Expand All @@ -317,7 +272,7 @@ Appium.prototype.getDevice = function (deviceType) {
, reset: !this.args.noReset
, fastReset: this.fastReset
, fastClear: this.desiredCapabilities.fastClear
, fullReset: this.fullReset
, fullReset: this.args.fullReset
, useKeystore: this.args.useKeystore
, keystorePath: this.args.keystorePath
, keystorePassword: this.args.keystorePassword
Expand Down Expand Up @@ -348,7 +303,7 @@ Appium.prototype.getDevice = function (deviceType) {
, reset: !this.args.noReset
, systemPort: this.args.selendroidPort
, fastReset: this.fastReset
, fullReset: this.fullReset
, fullReset: this.args.fullReset
, useKeystore: this.args.useKeystore
, keystorePath: this.args.keystorePath
, keystorePassword: this.args.keystorePassword
Expand Down
6 changes: 1 addition & 5 deletions lib/devices/device.js
Expand Up @@ -19,14 +19,10 @@ Device.prototype.init = function () {
this.tempFiles = [];
this.args = {};
this.capabilities = {};
this.capOverrides = [
"app"
, "launchTimeout"
];
};

Device.prototype.configure = function (args, caps) {
_.each(this.capOverrides, function (cap) {
_.each(caps, function (val, cap) {
this.setArgFromCap(cap, cap);
}.bind(this));
_.extend(this.args, args);
Expand Down

0 comments on commit b45f324

Please sign in to comment.