Skip to content

Commit

Permalink
fix a few ios bugs and add list of things that our testsuite doesn't …
Browse files Browse the repository at this point in the history
…cover yet
  • Loading branch information
jlipps committed Mar 4, 2014
1 parent 7ac5c17 commit e4e1936
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
8 changes: 7 additions & 1 deletion lib/appium.js
Expand Up @@ -56,6 +56,12 @@ Appium.prototype.registerConfig = function (configObj) {
this.serverConfig = configObj;
};

Appium.prototype.deviceIsRegistered = function (deviceType) {
if (deviceType === DT_SAFARI) deviceType = DT_IOS;
if (deviceType === DT_CHROME) deviceType = DT_ANDROID;
return _.has(this.serverConfig, deviceType);
};

Appium.prototype.preLaunch = function (cb) {
logger.info("Pre-launching app");
var caps = {};
Expand Down Expand Up @@ -160,7 +166,7 @@ Appium.prototype.configure = function (args, desiredCaps, cb) {
return cb(e);
}

if (!_.has(this.serverConfig, deviceType)) {
if (!this.deviceIsRegistered(deviceType)) {
logger.error("Trying to run a session for device '" + deviceType + "' " +
"but that device hasn't been configured. Run config");
return cb(new Error("Device " + deviceType + " not configured yet"));
Expand Down
5 changes: 2 additions & 3 deletions lib/devices/ios/ios.js
Expand Up @@ -53,8 +53,7 @@ IOS.prototype.init = function () {
this._deviceInit();
this.appExt = ".app";
this.capabilities = {
version: '0.0'
, webStorageEnabled: false
webStorageEnabled: false
, locationContextEnabled: false
, browserName: 'iOS'
, platform: 'MAC'
Expand Down Expand Up @@ -320,7 +319,7 @@ IOS.prototype.onInstrumentsLaunch = function (cb) {
};

IOS.prototype.setBundleId = function (cb) {
if (this.args.bundleId !== null) {
if (this.args.bundleId) {
cb();
} else {
this.proxy('au.bundleId()', function (err, bId) {
Expand Down
2 changes: 1 addition & 1 deletion lib/devices/ios/safari.js
Expand Up @@ -183,7 +183,7 @@ Safari.prototype.setInitialOrientation = function (cb) {
this._setInitialOrientation(cb);
};

Safari.prototype._setBootstrapConfig = IOS.prototype._setBootstrapConfig;
Safari.prototype._setBootstrapConfig = IOS.prototype.setBootstrapConfig;
Safari.prototype.setBootstrapConfig = function (cb) {
if (this.args.udid) {
logger.info("Not setting bootstrap config because we're on " +
Expand Down
6 changes: 6 additions & 0 deletions test/README.md
@@ -0,0 +1,6 @@
Here's a list of things that aren't tested in this suite:

* real devices
* SafariLauncher
* --default-device vs not (depends on server args during test)
* unexpected instruments crash mid-test

0 comments on commit e4e1936

Please sign in to comment.