Class: Webdrone::Wait
- Inherits:
-
Object
- Object
- Webdrone::Wait
- Defined in:
- lib/webdrone/wait.rb
Instance Attribute Summary collapse
-
#a0 ⇒ Object
Returns the value of attribute a0.
-
#ignore ⇒ Object
Returns the value of attribute ignore.
Instance Method Summary collapse
- #for ⇒ Object
-
#initialize(a0) ⇒ Wait
constructor
A new instance of Wait.
- #time(val) ⇒ Object
Constructor Details
#initialize(a0) ⇒ Wait
Returns a new instance of Wait.
11 12 13 14 15 16 17 18 |
# File 'lib/webdrone/wait.rb', line 11 def initialize(a0) @a0 = a0 @ignore = [] @ignore << Selenium::WebDriver::Error::StaleElementReferenceError @ignore << Selenium::WebDriver::Error::NoSuchElementError @ignore << Selenium::WebDriver::Error::NoSuchFrameError @ignore << Selenium::WebDriver::Error::InvalidSelectorError end |
Instance Attribute Details
#a0 ⇒ Object
Returns the value of attribute a0.
9 10 11 |
# File 'lib/webdrone/wait.rb', line 9 def a0 @a0 end |
#ignore ⇒ Object
Returns the value of attribute ignore.
9 10 11 |
# File 'lib/webdrone/wait.rb', line 9 def ignore @ignore end |
Instance Method Details
#for ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/webdrone/wait.rb', line 20 def for if @a0.conf.timeout Selenium::WebDriver::Wait.new(timeout: @a0.conf.timeout, ignore: @ignore).until do yield end else yield end rescue => exception Webdrone.report_error(@a0, exception, Kernel.caller_locations) end |
#time(val) ⇒ Object
32 33 34 35 36 |
# File 'lib/webdrone/wait.rb', line 32 def time(val) sleep val rescue => exception Webdrone.report_error(@a0, exception, Kernel.caller_locations) end |