diff --git a/lib/devices/ios/ios-hybrid.js b/lib/devices/ios/ios-hybrid.js index ec213dbec..4950395d6 100644 --- a/lib/devices/ios/ios-hybrid.js +++ b/lib/devices/ios/ios-hybrid.js @@ -10,14 +10,14 @@ var iOSHybrid = {}; iOSHybrid.closeAlertBeforeTest = function (cb) { this.proxy("au.alertIsPresent()", function (err, res) { - if (!err && res !== null && typeof res.value !== "undefined" && res.value === true) { + if (!err && res !== null && typeof res !== "undefined" && res.value === true) { logger.debug("Alert present before starting test, let's banish it"); this.proxy("au.dismissAlert()", function () { logger.debug("Alert banished!"); - cb(true); + cb(null, true); }); } else { - cb(false); + cb(null, false); } }.bind(this)); }; @@ -69,7 +69,7 @@ iOSHybrid.listWebFrames = function (cb, exitCb) { var loopClose = function () { loopCloseRuns++; if (!isDone && loopCloseRuns < 3) { - this.closeAlertBeforeTest(function (didDismiss) { + this.closeAlertBeforeTest(function (err, didDismiss) { if (!didDismiss) { setTimeout(loopClose, 1000); }