Class: Watir::Browser
- Inherits:
-
Object
- Object
- Watir::Browser
- Defined in:
- lib/sakai-oae-test-api/gem_extensions.rb
Instance Method Summary collapse
- #back_to_top ⇒ Object (also: #return_to_top, #scroll_to_top)
- #linger_for_ajax(timeout = 5) ⇒ Object
Instance Method Details
#back_to_top ⇒ Object 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 |