Module: Rufus

Included in:
Accessors::View
Defined in:
lib/rufus.rb,
lib/rufus/driver.rb,
lib/rufus/navigation.rb,
lib/rufus/accessors/view.rb,
lib/rufus/drivers/iOS_device.rb,
lib/rufus/accessors/accessors.rb,
lib/rufus/drivers/iOS_simulator.rb

Defined Under Namespace

Modules: Accessors, Drivers, Navigation Classes: Driver

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(cls) ⇒ Object



7
8
9
# File 'lib/rufus.rb', line 7

def self.included(cls)
  cls.extend Rufus::Accessors
end

Instance Method Details

#displayed_after_wait?(view, timeout = 5) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
24
25
26
27
28
29
# File 'lib/rufus.rb', line 21

def displayed_after_wait?(view, timeout = 5)
  wait = Selenium::WebDriver::Wait.new :timeout => timeout
  begin
    wait.until{view.displayed?}
  rescue Selenium::WebDriver::Error::TimeOutError
    return false
  end
  true
end

#enabled_after_wait?(view, timeout = 5) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
34
35
36
37
38
39
# File 'lib/rufus.rb', line 31

def enabled_after_wait?(view, timeout = 5)
  wait = Selenium::WebDriver::Wait.new :timeout => timeout
  begin
    wait.until{view.displayed?}
  rescue Selenium::WebDriver::Error::TimeOutError
    return false
  end
  true
end

#exists_after_wait?(view, timeout = 5) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
# File 'lib/rufus.rb', line 11

def exists_after_wait?(view, timeout = 5)
  wait = Selenium::WebDriver::Wait.new :timeout => timeout
  begin
    wait.until{view.exists?}
  rescue Selenium::WebDriver::Error::TimeOutError
    return false
  end
  true
end