Module: SeleniumRecord::Waits::ClassMethods
- Defined in:
- lib/selenium_record/waits.rb
Overview
Utilities for waiting methods
Instance Method Summary collapse
-
#js_inactive_script ⇒ String
The string containing javascript code to be evaluated to check if there are ajax calls pending.
- #seconds_for(opts) ⇒ Object
-
#wait_for(seconds = DEFAULT_WAITING_TIME) ⇒ Object
Wait selenium execution until a condition take place.
Instance Method Details
#js_inactive_script ⇒ String
Returns the string containing javascript code to be evaluated to check if there are ajax calls pending.
93 94 95 96 97 |
# File 'lib/selenium_record/waits.rb', line 93 def js_inactive_script { jquery: 'return $.active' }[Configuration.js_library] end |
#seconds_for(opts) ⇒ Object
99 100 101 102 103 |
# File 'lib/selenium_record/waits.rb', line 99 def seconds_for(opts) seconds = opts[:seconds] return seconds if seconds 20 end |
#wait_for(seconds = DEFAULT_WAITING_TIME) ⇒ Object
Wait selenium execution until a condition take place
87 88 89 |
# File 'lib/selenium_record/waits.rb', line 87 def wait_for(seconds = DEFAULT_WAITING_TIME) Selenium::WebDriver::Wait.new(timeout: seconds).until { yield } end |