Skip to content

Commit

Permalink
make sure we don't send status objects back to appium#start (fix #1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Jan 31, 2014
1 parent c515951 commit 080d792
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/devices/ios/safari.js
Expand Up @@ -2,6 +2,7 @@

var IOS = require('./ios.js')
, logger = require('../../server/logger.js').get('appium')
, status = require("../../server/status.js")
, _ = require('underscore');

var Safari = function (args) {
Expand Down Expand Up @@ -58,9 +59,13 @@ Safari.prototype.navToLatestAvailableWebview = function (cb) {
if (parseInt(this.iOSSDKVersion, 10) >= 7 && !this.udid) {
logger.info("We're on iOS7 simulator: clicking apple button to get into a webview");
this.findAndAct('xpath', '//window[2]/scrollview[1]/button[1]', 0, 'click', [], function (err, res) {
if (this.checkSuccess(err, res, cb)) {
navToView();
if (err || res.status !== status.codes.Success.code) {
var msg = "Could not successfully navigate to a working Safari " +
"webview. Original error: " + (err ? err.message : "unknown");
logger.error(msg);
return cb(new Error(msg));
}
navToView();
}.bind(this));
} else {
navToView();
Expand Down

0 comments on commit 080d792

Please sign in to comment.