Skip to content

Commit

Permalink
Merge pull request #8 from Slike9/patch-1
Browse files Browse the repository at this point in the history
Page reload support added for Waiter
  • Loading branch information
wrozka committed Mar 20, 2014
2 parents 63db812 + c0fa62b commit ef7184a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/capybara/angular/waiter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def wait_until_ready
start = Time.now
until ready?
timeout! if timeout?(start)
setup_ready if page_reloaded_on_wait?
sleep(0.01)
end
end
Expand Down Expand Up @@ -54,6 +55,10 @@ def setup_ready
});
JS
end

def page_reloaded_on_wait?
page.evaluate_script("window.angularReady === undefined")
end
end
end
end

0 comments on commit ef7184a

Please sign in to comment.