mirror of
https://github.com/appium/appium.git
synced 2026-02-08 02:30:32 -06:00
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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user