Class: Watir::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/sakai-oae-test-api/gem_extensions.rb

Instance Method Summary collapse

Instance Method Details

#back_to_topObject Also known as: return_to_top, scroll_to_top



144
145
146
# File 'lib/sakai-oae-test-api/gem_extensions.rb', line 144

def back_to_top
  self.execute_script("javascript:window.scrollTo(0,0)")
end

#linger_for_ajax(timeout = 5) ⇒ Object



135
136
137
138
139
140
141
142
# File 'lib/sakai-oae-test-api/gem_extensions.rb', line 135

def linger_for_ajax(timeout=5)
  end_time = ::Time.now + timeout
  while self.execute_script("return jQuery.active") > 0
    sleep 0.2
    break if ::Time.now > end_time
  end
  self.wait(timeout + 10)
end