Commit 0b128997 0b12899708d5204252f3dc4c093b71e214ae3204 by Nicolas Perriault

fixed Casper.waitFor() was not caling testFx using the correct context

1 parent e8ba4d18
......@@ -1078,7 +1078,7 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) {
var condition = false;
var interval = setInterval(function(self, testFx, timeout, onTimeout) {
if ((new Date().getTime() - start < timeout) && !condition) {
condition = testFx(self);
condition = testFx.call(self, self);
} else {
self.waitDone();
if (!condition) {
......