fixed Casper.wait()
Showing
1 changed file
with
3 additions
and
3 deletions
... | @@ -651,7 +651,7 @@ | ... | @@ -651,7 +651,7 @@ |
651 | this.delayedExecution = true; | 651 | this.delayedExecution = true; |
652 | var start = new Date().getTime(); | 652 | var start = new Date().getTime(); |
653 | var interval = setInterval(function(self, then) { | 653 | var interval = setInterval(function(self, then) { |
654 | if (!new Date().getTime() - start < timeout) { | 654 | if (new Date().getTime() - start > timeout) { |
655 | self.delayedExecution = false; | 655 | self.delayedExecution = false; |
656 | self.log("wait() finished wating for " + timeout + "ms.", "info"); | 656 | self.log("wait() finished wating for " + timeout + "ms.", "info"); |
657 | if (then) { | 657 | if (then) { |
... | @@ -712,8 +712,8 @@ | ... | @@ -712,8 +712,8 @@ |
712 | * Waits until an element matching the provided CSS3 selector exists in | 712 | * Waits until an element matching the provided CSS3 selector exists in |
713 | * remote DOM to process a next step. | 713 | * remote DOM to process a next step. |
714 | * | 714 | * |
715 | * @param String selector A CSS3 selector | 715 | * @param String selector A CSS3 selector |
716 | * @param Function then The next step to perform (optional) | 716 | * @param Function then The next step to perform (optional) |
717 | * @param Function onTimeout A callback function to call on timeout (optional) | 717 | * @param Function onTimeout A callback function to call on timeout (optional) |
718 | * @param Number timeout The max amount of time to wait, in milliseconds (optional) | 718 | * @param Number timeout The max amount of time to wait, in milliseconds (optional) |
719 | * @return Casper | 719 | * @return Casper | ... | ... |
-
Please register or sign in to post a comment