Simplify the javascript_test?
helper
Also don't try to run `page.evaluate_script` when we're not in a JavaScript test.
This commit is contained in:
parent
40ba2f7d20
commit
5647d5deaf
1 changed files with 3 additions and 1 deletions
|
@ -6,10 +6,12 @@ module WaitForAjax
|
|||
end
|
||||
|
||||
def finished_all_ajax_requests?
|
||||
return true unless javascript_test?
|
||||
|
||||
page.evaluate_script('jQuery.active').zero?
|
||||
end
|
||||
|
||||
def javascript_test?
|
||||
[:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver)
|
||||
Capybara.current_driver == Capybara.javascript_driver
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue