Commit 61e42819 61e42819e6c0ae10838715033522edbceb97c7e7 by JF Paradis

refs #417 - Added options retryTimeout

1 parent 4817c308
......@@ -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
......@@ -1342,7 +1343,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;
};
......@@ -1875,7 +1876,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);
});
};
......