make sure executeAsync callback address/port aren't lost between sessions

cc @sebv, this is what was going wrong before
This commit is contained in:
Jonathan Lipps
2014-08-22 21:27:25 -04:00
parent ad787fe65a
commit f122b0562a
3 changed files with 8 additions and 6 deletions

View File

@@ -23,7 +23,12 @@ var DT_IOS = "ios"
var Appium = function (args) {
this.args = _.clone(args);
this.serverArgs = _.clone(args);
this.args.callbackAddress = this.args.callbackAddress || this.args.address;
this.args.callbackPort = this.args.callbackPort || this.args.port;
// we need to keep an unmodified copy of the args so that we can restore
// any server arguments between sessions to their default values
// (otherwise they might be overridden by session-level caps)
this.serverArgs = _.clone(this.args);
this.rest = null;
this.webSocket = null;
this.deviceType = null;
@@ -38,8 +43,6 @@ var Appium = function (args) {
this.defCommandTimeoutMs = this.args.defaultCommandTimeout * 1000;
this.commandTimeoutMs = this.defCommandTimeoutMs;
this.commandTimeout = null;
this.args.callbackAddress = this.args.callbackAddress || this.args.address;
this.args.callbackPort = this.args.callbackPort || this.args.port;
};
Appium.prototype.attachTo = function (rest) {

View File

@@ -1796,6 +1796,7 @@ iOSController.execute = function (script, args, cb) {
iOSController.executeAsync = function (script, args, responseUrl, cb) {
if (this.isWebContext()) {
logger.debug("Response url for executeAsync is " + responseUrl);
this.convertElementForAtoms(args, function (err, res) {
if (err) {
cb(null, res);

View File

@@ -1,11 +1,9 @@
"use strict";
var env = require('../../../helpers/env'),
setup = require("../setup-base"),
var setup = require("../setup-base"),
webviewHelper = require("../../../helpers/webview"),
loadWebView = webviewHelper.loadWebView,
isChrome = webviewHelper.isChrome,
ChaiAsserter = require('../../../helpers/asserter.js').ChaiAsserter,
Q = require('q'),
spinTitle = webviewHelper.spinTitle,
spinWait = require('../../../helpers/spin.js').spinWait,