Commit 369dd7d3 369dd7d3fdce842bca2dd004065b4b632a22b0d1 by Nicolas Perriault

Merge pull request #424 from jfparadis/option-retryTimeout

refs #417 - Added options retryTimeout
2 parents 73d31860 61e42819
......@@ -329,6 +329,15 @@ Viewport size, eg. ``{width: 800, height: 600}``
.. index:: timeout
``retryTimeout``
-------------------------------------------------------------------------------
**Type:** ``Number``
**Default:** ``100``
Default delay between attempts, for ``wait*`` family functions.
``waitTimeout``
-------------------------------------------------------------------------------
......
......@@ -119,6 +119,7 @@ var Casper = function Casper(options) {
stepTimeout: null,
timeout: null,
verbose: false,
retryTimeout: 100,
waitTimeout: 5000
};
// options
......@@ -1368,7 +1369,7 @@ Casper.prototype.run = function run(onComplete, time) {
}
this.log(f("Running suite: %d step%s", this.steps.length, this.steps.length > 1 ? "s" : ""), "info");
this.emit('run.start');
this.checker = setInterval(this.checkStep, (time ? time: 100), this, onComplete);
this.checker = setInterval(this.checkStep, (time ? time: this.options.retryTimeout), this, onComplete);
return this;
};
......@@ -1905,7 +1906,7 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) {
if (then) {
self.then(then);
}
}, 100, this, testFx, timeout, onTimeout);
}, this.options.retryTimeout, this, testFx, timeout, onTimeout);
this.waiters.push(interval);
});
};
......