Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Correcting check method, because it was the wrong logic
Browse files Browse the repository at this point in the history
  • Loading branch information
afgoulart committed Nov 17, 2015
1 parent 8131bc8 commit f4657a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands/waitForUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ WaitForUrl.prototype.check = function() {

this.protocol.url(function(result) {
var now = new Date().getTime();

if (result.status === 0 && result.value !== self.url) {
if (result.status === 0 && result.value === self.url) {
setTimeout(function() {
var msg = self.messages.success + (now - self.startTimer) + ' milliseconds.';
self.cb.call(self.client.api, result.value);
self.client.assertion(true, !!result.value, false, msg, true);
return self.emit('complete');
}, self.timeout);
} else if (now - self.startTimer < self.ms && result.value == self.url) {
} else if (now - self.startTimer < self.ms) {
setTimeout(function() {
self.check();
}, 500);
Expand Down

0 comments on commit f4657a4

Please sign in to comment.