ruby on rails - Selenium Webdriver Turbolinks -


i writing selenium webdriver tests product utilizes turbolinks (in ruby). when click button have wait turbolinks work. when test jquery callbacks typically wait on code with:

driver.execute_script 'return jquery.active == 0' 

what can check via javascript verify turbolinks done? or there element can grab can same? see progress bar on top can't find element anywhere.

edit:

i'm able this:

driver.execute_script "$(document).on('page:load', function () { window.turbolinks = true; });" driver.execute_script "$(document).on('page:before-change', function () { window.turbolinks = false; });" 

on page load , can wait on window.turbolinks true

wait = selenium::webdriver::wait.new(:timeout => 10) wait.until { driver.execute_script 'return window.turbolinks;' } 

is there better way of handling this?

according turbolinks docs, progress bar has class turbolinks-progress-bar check existence of , wait go?


Comments